【发布时间】:2010-11-04 13:56:57
【问题描述】:
我们正在将 ASP.Net MVC 应用程序部署到运行 IIS 7.5 的 Windows 2008 R2 服务器。
部署后,我们在事件日志中收到此错误(我们还会收到一封电子邮件): c:\wwwroot\web.config 中第 x 行上的“无法识别的元素 'providerOption'” 即:
<providerOption name="CompilerVersion" value="v3.5">
位于我们标准网络配置的 system.codedom 编译器部分。我稍微调查了一下这个问题。 (我还查看了namespace details on msdn 以了解有关它的信息)。在许多其他解决方案中,我发现this post 建议更新我们服务器上的 FX_Schema.xml 文件。 (我觉得问题就出在这里,如果我弄错了,请纠正我)
我查看了 fx_schema 文件,并且根据事件查看器中的定义,属性“providerOption”不在此模式中!这是 FX_schema.xml 中 system.codedom 部分的副本
<sectionSchema name="system.codedom">
<element name="compilers">
<collection addElement="compiler" removeElement="remove" clearElement="clear">
<attribute name="language" type="string" isCombinedKey="true" />
<attribute name="extension" type="string" isCombinedKey="true" />
<attribute name="type" type="string" />
<attribute name="warningLevel" type="int" />
<attribute name="compilerOptions" type="string" />
</collection>
</element>
</sectionSchema>
我确信我不会是唯一遇到此问题的人,但有其他人之前遇到过此问题并找到解决方案吗?
编辑:另一种快速生成的方法是(在 Windows 7 中的 IIS 7 上)
在 IIS 管理控制台中,在网站主页中打开您的 MVC 网站。您应该看到 ASP.NET、IIS 和管理组。在管理下,打开“配置编辑器”。我收到这里弹出的错误消息!
编辑:我的网络配置副本:
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4"
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4"
type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="OptionInfer" value="true"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
【问题讨论】:
-
没人会帮我吗?可能需要等待下一次windoes更新...... :-(
-
无法轻易解决这个问题,看来唯一的办法是将我们的项目升级到.net 4,这需要一些时间。我已经接受了布赖恩的工作,直到找到更好的解决方案。
标签: asp.net asp.net-mvc xml deployment iis-7