|
-
June 18th, 2010, 03:03 AM
#1
interoperability .net 2.0 & .net 4.0
Hi all,
is it possible to call some methods of a class library developed with .net framework 4.0 in an application developed by using .net framework 2.0?
Many thanks,
Francesco
-
June 18th, 2010, 08:31 AM
#2
Re: interoperability .net 2.0 & .net 4.0
As long as 4.0FW was installed... I don't see why not... Good question... never occurred to me. I've gone the other way, where a 3.5 object called into 2.0, and that worked, I guess I kind of assumed that it would work going upwards too... I'll have to try that later.
-tg
-
June 18th, 2010, 08:35 AM
#3
Re: interoperability .net 2.0 & .net 4.0
no it is not possible your manifest defines the version of the dlls that are required to run your application. If those dlls are not present the application will not run.
-
June 18th, 2010, 10:07 AM
#4
Re: interoperability .net 2.0 & .net 4.0
True... if FW4.0 isn't installed on the system, there shouldn't be an expectation that it would run.... BUT... if FW4.0 IS installed...
-tg
-
June 18th, 2010, 10:17 AM
#5
Re: interoperability .net 2.0 & .net 4.0
Yes of course, I have installed both .net 2.0 and .net 4.0.
My question is about the use of a .net 4.0 class library.
If I add a reference to that class library in a .net 2.0 application an error occurs.
-
June 18th, 2010, 10:50 AM
#6
Re: interoperability .net 2.0 & .net 4.0
Well, then that should be your answer right there. It would seem that the answer is "no, you can't."
Just out of curiosity, what is the error you get?
-tg
-
June 20th, 2010, 04:16 AM
#7
Re: interoperability .net 2.0 & .net 4.0
If I'm correct (not 100% sure), you can't run .NET 2.0 DLLs in your .NET 4 application because they use a different CLR. .NET 2.0 uses the CLR 2.0 and .NET 4 uses the CLR 4.
You can use .NET 3.5 in a .NET 2.0 app because .NET 3.5 also uses the CLR 2.0.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|