How to call DLL developed in C# in VS 2005 from C# in VS 2003

G

Guest

I have lots of C# applications developed in Visual Studio 2003 which I have
not migrated into VS 2005.
Now I need to call a C# DLL developed in VS 2005 from these C# applications
of VS 2003.

When I tried to add a reference from VS 2003, I got the following error
message:

A reference to 'xxxxxx.dll' could not be added. This is not a valid assembly
or COM component. Only assemblies with extension 'dll' and COM components can
be referenced. Please make sure that the file is accessible, and that is is a
valid assembly or COM component.

And I tried to use Assembly to load this VS 2005 DLL dynamically, I got
error message like "invalid assembly".

Does anybody know how to call VS 2005 DLL's from VS 2003 applications?

Thanks a lot.
 
M

Marc Gravell

You can't; you can only have one version of the CLR per process, and
the 2.0 dlls use IL instructions (and of course, references) that
simply aren't supported in the 1.0/1.1 CLRs.

You can, however, use 1.1 dlls in 2.0

Marc
 

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