开发者

Referencing a .NET DLL from a different VS.NET version?

开发者 https://www.devze.com 2022-12-22 12:13 出处:网络
I have a Visual Studio 2003 project. I need to refer a library DLL which is built in VS 2005 to this project.

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开发者_如何学Python 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


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


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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消