Errors late-binding .net2.0 assembly from .net1.1

T

tlwright1414

I'm trying to late bind and invoke a method on a .net 2.0 assembly from
a .net 1.1 assembly. I'm getting and error 'The format of the file
'myAssembly.dll' is Invalid. Can't figure it out. Any suggestions are
much appreciated.

Assembly p = Assembly.LoadFrom( asFilePath );
object o = p.CreateInstance( asClassName );
object[] args = new object[4]{m_AssemblyDoc, ao, m_ProcessesDoc,
cbProduct.SelectedItem};

MethodInfo Method = o.GetType().GetMethod("Process");
Object obj = Activator.CreateInstance(o.GetType());
Method.Invoke( obj, args );
 
M

Mattias Sjögren

I'm trying to late bind and invoke a method on a .net 2.0 assembly from
a .net 1.1 assembly.

2.0 assemblies can only be loaded by the 2.0 CLR. I suspect you're
running with a previous version loaded.


Mattias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top