Unrecognized configuration section system.web.extensions
2012-04-02 10:40
405 查看
This error indicates that the system.web.extensions section is not defined anywhere in your web.config or machine.config. However if you check the machine.config in <<Windows Directory>>\Microsoft.NET\Framework\v4.0.30319\Config\machine.config
you can see this section declared.
Following things are to be taken care for your web app to use the machine config from v4.0 and not earlier versions.
Make sure that the Target Framework for all the projects in your solution are pointing to “.Net Framework 4”.
If your Web App is running on IIS make sure that the application pool is running on a .NET Framework 4 version.
Finally there is one more tricky part which usually is missed. Even if the error shows up after taking care of above 2 steps then open .csproj (or .vbproj for VB application) in a text editor and walkthrough to check if there
is any hard coded path reference to previous versions. For example something like this
Make sure that the path is rectified to point to v4.0 directory. Even better, make it configurable so that it does not break for any v.Next versions of .NET.
Hope that helps..
you can see this section declared.
Following things are to be taken care for your web app to use the machine config from v4.0 and not earlier versions.
Make sure that the Target Framework for all the projects in your solution are pointing to “.Net Framework 4”.
If your Web App is running on IIS make sure that the application pool is running on a .NET Framework 4 version.
Finally there is one more tricky part which usually is missed. Even if the error shows up after taking care of above 2 steps then open .csproj (or .vbproj for VB application) in a text editor and walkthrough to check if there
is any hard coded path reference to previous versions. For example something like this
<Target Name=”AfterBuild” Condition=”’$(MvcBuildViews)’==’true’”> <AspNetCompiler VirtualPath=”temp” ToolPath=”$(WINDIR)\Microsoft.NET\Framework\v2.0.50727” PhysicalPath=”$(ProjectDir)\..\$(ProjectName)” /> <AspNetCompiler VirtualPath=”temp” ToolPath=”$(WINDIR)\Microsoft.NET\Framework\v2.0.50727” PhysicalPath=”$(OutDir)\_PublishedWebsites\$(ProjectName)” /> </Target>
Make sure that the path is rectified to point to v4.0 directory. Even better, make it configurable so that it does not break for any v.Next versions of .NET.
Hope that helps..
相关文章推荐
- Unrecognized configuration section 'system.webServer' CKFinder - Setup Wizard for ASP
- [A]System.Web.WebPages.Razor.Configuration.HostSection 无法强制转换为 [B]System.Web.WebPages.Razor.Configuration.HostSection。
- 访问SharePoint站点:提示machine.config出错 Unrecognized configuration section system.serviceModel
- 调试MVC源代码时"[A]System.Web.WebPages.Razor.Configuration.HostSection 无法强制转换为 ..."解决办法
- System.Web.WebPages.Razor.Configuration.HostSection 无法强制转换
- 调试MVC源代码时"[A]System.Web.WebPages.Razor.Configuration.HostSection 无法强制转换为 ..."解决办法 分类: ASP.NET MVC 2012-12-09 10:49 6506人阅读 评论(3) 收藏
- 调试MVC源代码时"[A]System.Web.WebPages.Razor.Configuration.HostSection 无法强制转换为 ..."解决办法 分类: ASP.NET MVC 2012-12-09 10:49 6506人阅读 评论(3) 收藏
- web.config报 "Unrecognized configuration section dataConfiguration"错
- C# Unrecognized configuration section system.serviceModel
- 调试MVC源代码时"[A]System.Web.WebPages.Razor.Configuration.HostSection 无法强制转换为 ..."解决办法
- 升级mvc版本时后,System.InvalidCastException: [A]System.Web.WebPages.Razor.Configuration.HostSection 无法强制转换
- [A]System.Web.WebPages.Razor.Configuration.HostSection 无法强制转换为 [B]System.Web.WebPages.Razor.Configur
- MVC 因Nuget管理包升级一些引用的DLL组件造成的无法强制转换为 System.Web.WebPages.Razor.Configuration.HostSection
- 配置错误定义了重复的“system.web.extensions/scripting/scriptResourceHandler” 解决办法
- System.Web.Extensions, Version=1.0.61025.0, Culture=neutral
- IIS 错误:定义了重复的“system.web.extensions/scripting/scriptResourceHandler”节
- 配置错误定义了重复的“system.web.extensions/scripting/scriptResourceHandler” 解决办法
- webpack 升级Getting error: configuration.resolve.extensions[0] should not be empty
- 定义了重复的“system.web.extensions/scripting/scriptResourceHandler”节点
- 配置错误定义了重复的“system.web.extensions/scripting/scriptResourceHandler” 解决办法