Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I reference a .NET 3.5 .DLL in a 4.0 app?

The subject says it all... If I've got a .NET 4.0 app, can I add a reference to 2.0/3.0/3.5 .DLL? I don't have VS2010 installed so I can't check myself (I'm doing research at the moment).

I've tried to find information on both on SO and Google, but I get conflicting answers.

like image 536
Vilx- Avatar asked Nov 29 '10 11:11

Vilx-


People also ask

Can you install .NET 3.5 if 4.0 is already installed?

Yes. You can install and run multiple versions of the . NET Framework on a computer. You can install the versions in any order.

Is. NET 4. 5 backwards compatible with 3. 5?

NET Framework 4.5 is backward-compatible with applications that were built with the . NET Framework versions 1.1, 2.0, 3.0, 3.5, and 4.

Is NET Framework backward-compatible?

NET Framework 4.7 from any installer. . NET Framework 4.8 is backwards compatible and is capable of running applications specifically targeted for .

Can you have .NET 3.5 and 4.5 installed?

NET Framework 4.5 (or one of its point releases) runs side by side with versions 1.1, 2.0, and 3.5, and is an in-place update that replaces version 4. For apps that target versions 1.1, 2.0, and 3.5, you can install the appropriate version of . NET Framework on the target machine to run the app in its best environment.


1 Answers

Yes, you can - but if it's a mixed mode assembly (i.e. contains a mixture of native code and .NET code) then I believe that can cause problems. (IIRC the MySql driver had this problem recently, and devs had to rebuild under .NET 4 to get it to work.)

like image 187
Jon Skeet Avatar answered Oct 21 '22 20:10

Jon Skeet