Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will .net 2.0 and 3.5 run side by side?

We're a development shop that still does most of our development in .net 2.0. We're starting to think about using some of the new things in 3.5 (LINQ, etc) and there are some other software packages we're looking at that need WPF and so on.

We'd like to get 3.5 up and running on our test server, but without wrecking any of the 2.0 sites we already have running (and we'd like them to keep running under 2.0). Are there any hidden issues I should know about, or can I just install 3.5 on our Server 2003 machine and be good to go?

(The specific concern being that despite Microsoft claiming the .net 2.0 components are the same in 3.5, that they actually changed something game-breaking.)

Update: Bolstered on by everyone's comments here and other reading, we decided to bite the bullet and install 3.5 on the server "just to see what happens."

On running the install program, we discovered (to our not inconsiderable surprise) that .net 3.5 had been installed back in August - and none of us had known about it.

Which, really, is about as seamless an upgrade as you can ask for.

Thanks, everybody!

like image 483
Electrons_Ahoy Avatar asked Jan 08 '09 00:01

Electrons_Ahoy


People also ask

Can multiple .NET versions coexist?

Microsoft designed the . NET Framework so that multiple versions of the framework can be installed and used at the same time. This means that there will be no conflict if multiple applications install different versions of the .

Can you have two versions of .NET Framework?

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

Is .NET 3.5 still needed?

You may need the .NET Framework 3.5 to run an app on Windows 11, Windows 10, Windows 8.1, and Windows 8. You can also use these instructions for earlier Windows versions.

Can .NET Core and .NET Framework coexist?

Yep, . NET 4.6, 4.7, 4.8, 5 and 6 can all coexist on the same machine.


2 Answers

2.0 will play nicely with 3.5. .NET 3.5 is really just some extra classes added on top on 2.0, so everything is compatible. I moved a bunch of projects from 2.0 to 3.5, and everything migrated very smoothly, with just a recompile.

like image 76
Alex Fort Avatar answered Sep 22 '22 02:09

Alex Fort


.Net 3.5 is, essentially a set of additional assemblies that run side-by-side with the 2.0 libraries. Not a single breaking change occurred to any of the existing 2.0 libraries. You can directly convert all of your 2.0 applications to 3.5 without a single problem. This includes running 2.0 applications on the 3.5 framework. Some optimizations and bug fixes were made to 2.0, but all public interfaces remain unchanged. This applies to all namespace including System.Web.

There were a lot of new features added in 3.0 and 3.5 versions of the framework such as WPF, entity framework, and several other "frameworks". Classes were added to existing namespaces but, they actually live in separate dll's.

One thing to note as FryGuy points out:

Be careful about installing 3.5 SP1, because it also installs 2.0 SP2, which adds some extra functions. This would be fine, except for visual studio will use IntelliSense and everything will compile fine and work great on the developer machine, but completely fail with an obscure error on computers with "just" 2.0.

An example of this is the method ManualResetEvent.WaitOne. SP1 added the overload WaitOne(int), whereas without it, you need to call WaitOne(int, false).

As CMS posted from 4GuysFromRolla:

Additive versions of the .NET Frameworks
(source: 4guysfromrolla.com)

like image 39
Micah Avatar answered Sep 21 '22 02:09

Micah