Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Framework effects of moving from 2.0 to 3.5?

I've started using Visual Studio 2008 and it keeps asking me to upgrade my 2.0 website project to 3.5 every time it opens.

  • What effectively happens when I "upgrade" a website project from 2.0 to 3.5 in Visual Studio?
  • Does it update my web.config? How exactly does it change my project/website/code?
  • Is there a potential for any 2.0 methods/settings to BREAK upon upgrade to 3.5?
  • Are there any gotchas involved?
like image 676
Matias Nino Avatar asked Sep 22 '08 15:09

Matias Nino


People also ask

Does NET Framework 4.7 include previous versions?

Yes, 4.7 overwrites any previously installed 4. x version. Make sure you don't also install 4.6, that will destroy the 4.7 install.

Is .NET Framework outdated?

NET is dead as a future framework for web applications and software. Microsoft won't be building for it and they won't support it. But software that already runs on . NET and is no longer being updated will still run on it.

Is .NET 2.0 still supported?

NET Framework 2.0 has been around for a decade but will be completely unsupported by Microsoft; the announced end of the extended support period is April 12, 2016. In lock-step with the . NET Framework, the corresponding version of Microsoft's development tool, Visual Studio 2005, is also at its end-of-life.

Can I upgrade my .NET Framework?

NET Framework, you can generally upgrade it to . NET Framework 4.5 and its point releases (4.5.


2 Answers

(As mentioned elsewhere across the other answers, plus some extras:)

  • Converting a VS 2005 solution to VS 2008 will mean that you'll need to maintain duplicates, or others must also be using Visual Studio 2008 (while the project file format (which from your question you're not using anyway) is in theory unchanged between 2005 and 2008, the solution files are not compatible...)

  • Converting the website to 3.5 mostly affects the web.config. Some references are added to a few default 3.5 assemblies, such as System.Core.dll. And it will add the IIS 7 sections (which is all ignored if the site is published to an IIS6 box).

  • Generally don't see new compile time errors from the upgrade (and if you do, wouldn't expect many). Both the C# and VB teams have put effort into ensuring backwards compatibility on all the new LINQ keywords... so you can have a local named "var" in a method named "where" in a class named "from" and everything compiles just fine... (an improvement for anyone who had symbols named "operator" in a VB 2003 codebase when upgrading to 2005 :-)

  • Obviously, once you've switched, you'll need .NET 3.5 on any server you deploy to. Unlike .NET 1.1 vs .NET 2.0 though, there are no CLR version / AppPool issues to worry about, it all runs in .NET 2.0. Read on below...

If you are worried about run-time regression for any existing .NET 2.0 code, there's good news and bad news.

The good news: regression is virtually unheard of.

The bad (or other good) news: If you've installed .NET 3.5 on a server running 2.0 sites, you've already tested for regressions :)

As mentioned above, .NET 3.5 is really just the .NET 2.0 CLR with some extra assemblies and new compiler functionality.

And when you install .NET 3.5, it also installs a service pack for .NET 2.0 and 3.0. So any breaking change would already be affecting .NET 2.0 websites, without any explicit upgrade step.

Scott Hanselman posted a good explanation of the difference between CLR version and .NET Runtime version here a while back.

One final comment - you should be aware that when using VS 2008 to target .NET 2.0, you are actually compiling against the updated .NET 2.0. So if you use one of the (very few, and rarely used) methods quietly added to the updated version of .NET 2.0, such as GCSettings.LatencyMode, when you deploy to a machine that has the original .NET 2.0 RTM, it will fail to run. Read about it in more detail here, and Scott also posted a full list of API changes here)

While actually encountering an issue like this is pretty unlikely, in some ways (even excluding the benefits of the new 3.5 features) you're better off on 3.5 :-)

like image 135
Matt Ryan Avatar answered Sep 23 '22 06:09

Matt Ryan


It updates your web.config to use a few newer dlls. I have yet to experience any breaking changes.

like image 21
Kevin Sheffield Avatar answered Sep 23 '22 06:09

Kevin Sheffield