I have a site in ASP.NET 2.0. I plan to move to 4.0. Is there any thing in particular I need to take care of or I just select the 4.0 framework and recompile and VS 2010 will update the web.config to reflect the changes?
5 Answers
There are some few thinks that you must take care of.
Read all the changes and have it near you on tests: http://www.asp.net/learn/whitepapers/aspnet4/breaking-changes
The validation mode has change: Can I deploy .net 4.0 web application on IIS6?
The default.aspx has change when you try to get the url : Default.aspx with IIS 6.0 and .Net 4?
I haven't been able to get the Conversion Wizard to reappear, but I have been able to convert to .NET 4.0 by:
Right Clicking on my website
Selecting Property Pages
Then go to Build tab
Change Target Framework
This made all the changes to my web.config automatically just like the conversion wizard would.

- 123
- 3
Just use the conversion wizard when prompted and you should be good. Note: if you are using source control with others, the version number in the project file will change (vs2008 = "9" and vs2010 = "10").
Also, if you experience any JavaScript issues, make sure you choose the correct setting for identifying the IDs in 4.0:
http://weblogs.asp.net/asptest/archive/2009/01/06/asp-net-4-0-clientid-overview.aspx

- 15,108
- 7
- 50
- 91
-
Any inherent advantage moving to .NET 4.0 if I am not using new features? – Karl Iot Sep 25 '10 at 04:25
-
Yes, since the migration is painless, it's always good to "future proof" yourself. You can check if there are any specific features you want to avail of here: http://www.asp.net/learn/whitepapers/aspnet4 – IrishChieftain Sep 25 '10 at 04:38
one thing you need to do upgrading or not is the workaround to the padding oracle vulnerability.
Even more important when you move to anything above 3.5 sp1.
Overall it should just work.

- 35,831
- 5
- 65
- 110
-
Any inherent advantage moving to .NET 4.0 if I am not using new features? – Karl Iot Sep 25 '10 at 04:24
-
Honestly I haven't thought about it that way / don't recall at the moment. By now I'm so used at using 3.5+ features that I haven't payed attention to any info on same existing features improvements (specially 2.0 features). – eglasius Sep 25 '10 at 15:36
-
The padding oracle vulnerability is no different in .NET4 versus .NET2, the only difference is that the newer version provides the ability to further protect from timing attacks which could conceivably exploit the flaw: http://www.troyhunt.com/2010/09/why-sleep-is-good-for-your-apps-padding.html – Troy Hunt Sep 26 '10 at 01:16
-
@Troy that's misleading. Sure the padding oracle vulnerability is there in both, But what you can gain with it is a Complete different story: http://eglasius.blogspot.com/2010/09/aspnet-padding-oracle-how-it-relates-to.html. Unfortunately I don't have a ms link at the moment, but they also mentioned the part of the issue that allowed to serve files like the web.config issue occurs in 3.5 sp1 and above. – eglasius Sep 26 '10 at 01:23
-
to be clear, I agree with what you said in the article about earlier versions still being exposed, but the level of vulnerability Is different because of the separate issue that exposes the web.config. I sent a comment to your very nice article. – eglasius Sep 26 '10 at 01:48
-
1I actually think we're both correct; the ability to apply the padding oracle attack POET style (i.e. decoding / encoding the ciphertext) is equal in both frameworks. If successful, there is more to exploit in the newer versions (which is a very important distinction) but conversely, the newer versions offer the ability to add the additional defence layer by means of random sleep. Anyway, that's probably getting a bit semantic and I think we're starting to hijack Karl's thread! – Troy Hunt Sep 26 '10 at 04:16
You can find good documentation for the migration from Framework 2.0 to 4.0 on below website.
https://msdn.microsoft.com/en-us/library/dd483478.aspx
It helps me lot.

- 230
- 2
- 10