If you're getting started with ASP.NET 4, there's a few things you might run into that could throw you for a loop if you didn't expect them. Remember that while ASP.NET is a very compatible release, it is also a side-by side release so this was a good time to make breaking changes for the better.
Note that just installing ASP.NET 4 won't break your applications. You can happily run all your ASP.NET applications side by side each in their own AppPool. These first two "gotchas" below are if you're moving an existing application over to .NET 4. The third gotcha is an install ordering thing.
Request validation is more strict by default in ASP.NET 4. Pretty much anyone moving a non-trivial ASP.NET 2 application over to ASP.NET 4 has a good likelihood of running into this. The workaround is pretty simple. If you want to revert the behavior of the validator to pre-ASP.NET 4, add this to your web.config:
<httpRuntime requestValidationMode="2.0" />
That's it. Of course, you can always dig in a bit and see why your app doesn't like the stricter validation and fix that as well.
If you just go into IIS and change your existing app's AppPool to ASP.NET 4, you might get an error. The nitty gritty details are here, but the average customer's brain will melt reading the details.
So instead, a quick way to fix this (assuming you don't want to upgrade the app) is
If you install VS2010 and/or .NET 4 first, then later install IIS, you need make sure IIS is configured to know about ASP.NET 4 otherwise IIS will have no idea how to run ASP.NET 4 applications.
There's a simple workaround:
or for future reference, try to enable IIS and the ASP.NET extensibility option *first* when your are building machines or VMs. That way when VS 2010 or .NET are subsequently installed, the installation will automatically detect the presence of IIS and will auto-register with it.
Hope this helps. The complete list of ASP.NET 4 Breaking Changes is here.
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. I am a failed stand-up comic, a cornrower, and a book author.
Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.