views:

46

answers:

3

Hi,

I have a Visual Studio 2003 project.

I need to refer a library DLL which is built in VS 2005 to this project.

Is this possible? while directly referring i am getting an error in Visual Studio stating that "..this is not a valid library or com component...".

But is there any workaround.I cannot convert my Visual Studio project from 2003 to 2005 as of now.

Please advice. (If there is workaround it will be very useful)

Thanks

SNA

+3  A: 

You cannot use dlls created in vs2005 in a vs2003 application, because vs2005 targets the v2.0 of the runtime, whereas 2003 targets 1.1.

Only one version of a framework can be loaded into a given process.

Why Visual Studio targets only one version of the .NET Framework

astander
Thanks.But is ther any way i can convert this dll(2.0 version) to 1.1 version using some tools etc.I dont have the code i have only the dll(2.0 ) version which does some common tasks.and how can i find the dot net version from a dll.
swapna
You can convert by hand. You can use reflector to get the source
Preet Sangha
You can decompile the original, and then try to convert the assembly to the previous version. http://stackoverflow.com/questions/1503943/how-to-decompile-a-dll-file-created-in-vs-net
astander
A: 

You cannot reference them and use them in the same process as astander says. However you can work around the limitation. If you use a second .net 2.0 CLR process to host the other assembly and then you can use comunicate between the two processes, if you use a shared protocol such as sockets, named pipes, mailsolts, memory mapped files etc.

Its not trivial but it shouldn't be two hard but in essence you are doing your own marshalling.

Preet Sangha
A: 

If you have the source code you may compile in VS2005 with the .Net 1.1 compiler.

Sid