Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you mix .NET framework Versions in a solution?

Our codebase where I work is .NET 2.0. For our new assembly/DLLs/web applications I would love to take advantage of what 3.5 has to offer.

Can one mix .NET frameworks(per assembly) in a solution? Are there any IIS related caveats to this?

I would love to hear any positive/negative/howto feedback. Let me know!

Thanks!

like image 475
Micah Avatar asked Mar 12 '10 13:03

Micah


People also ask

Can I have multiple versions of .NET Framework?

It is safe to install multiple versions of the . NET Framework on your computer.

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.

Do I need to install all versions of .NET Framework?

There are 4 distinct versions of the . net framework. All of those can be installed and uninstalled independently.

Are .NET versions backwards compatible?

NET Framework 4 is backward-compatible with applications that were built with the . NET Framework versions 1.1, 2.0, 3.0, and 3.5. In other words, applications and components built with previous versions of the . NET Framework will work on the .


2 Answers

Yes you can do this in Visual Studio and it is called Multi-Targeting.

Scott Guthrie has a great blog-entry on Multi-Targeting Support in Visual Studio.

VS 2008 was the first release of Visual Studio that included multi-targeting support for .NET. What this meant was that you could use VS 2008 to create and edit not only .NET 3.5 projects, but also .NET 3.0 and .NET 2.0 projects as well. This allowed developers to more quickly upgrade and take advantage of new Visual Studio tooling features – without having to necessarily require the newer version of .NET to be installed on the clients and production servers running their applications.

Cheers

like image 86
Faizan S. Avatar answered Sep 23 '22 14:09

Faizan S.


You can use 2.0, 3.0 and 3.5 together according to: http://msdn.microsoft.com/en-us/library/bb383796(v=vs.90).aspx

like image 29
BG BG Avatar answered Sep 23 '22 14:09

BG BG