Problem with <system.web.extensions> config group when upgrading to .NET 4.0

I ran into this issue recently and was able to resolve it after some troubleshooting. Hope what I did will help fix your issue too. 1. Make sure the App pool you are running for the site is using .NET 4 pipeline 2. Open your .csproj (or .vbproj if yours is a VB project) in Notepad and walkthrough the file and check if there are any hard coded references to v2.0 Framework files. In my case we had a "After Build" task that was using v2.0 compiler path which forced the app to still use 2.0 runtime. It was like below.

<Target Name=”AfterBuild” Condition=”’$(MvcBuildViews)’==’true’”>
<AspNetCompiler Condition=”’$(IsDesktopBuild)’ != ‘false’” VirtualPath=”temp” ToolPath=”$(WINDIR)\Microsoft.NET\Framework\v2.0.50727” PhysicalPath=”$(ProjectDir)\..\$(ProjectName)” />
<AspNetCompiler Condition=”’$(IsDesktopBuild)’ == ‘false’” VirtualPath=”temp” ToolPath=”$(WINDIR)\Microsoft.NET\Framework\v2.0.50727” PhysicalPath=”$(OutDir)\_PublishedWebsites\$(ProjectName)” />

Make sure to change them to v4.0 or even better make them confiurable. Hope that helps.

-Vamsi


As i've had no answers, and extensive googling resulted in no love either, i've decided to stick my original fix (adding the system.web.extensions section back into the web.config).