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

一世执手 提交于 2019-12-05 02:36:34

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).

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

Two more bits of info that may or may not help.

  1. the only difference from the above sectionGroup and my machine sectionGroup is the version=3.5.0.0 here and version=4.0.0.0 in the machine.config. 1.
  2. The error in the event log is "Could not load all ISAPI filters for site..." Could there be an install of System.Web.Extensions that is not registered properly with .net 4?

I'd love to test more on this, but unfortunately I only see this behavior in a production system and not a dev system.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!