We deploy our ASP.Net MVC application on a Windows 2008 R2 server running IIS 7.5.
After deployment, we get this error in the event log (we also get an email): "An unrecognized providerOption element in line x in c: \ wwwroot \ web.config which:
<providerOption name="CompilerVersion" value="v3.5">
located in the system.codedom compilers section of our standard web configuration. I researched the problem a bit. (I also checked the namespace information in msdn to find out about this abit). Among many other solutions, I found this post , recommending updating the FX_Schema.xml file on our server. (I think this is a problem, please correct me if I am wrong)
I looked at the fx_schema file and, as defined in the event viewer, the "providerOption" attribute is missing from this diagram! Here is a copy of the system.codedom section from the FX_schema.xml file
<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>
I am sure that I cannot be the only person who has this problem, but has anyone else had anyone come across this before and found a solution?
EDIT: Another way to quickly accomplish this (on IIS 7 on Windows 7)
In the IIS Managment console, open your MVC website at the home website. You should see the ASP.NET, IIS, and Managment groups. In the Management section, open the Configuration Editor. I get an error message that appears here!
EDIT: My copy of the web configuration:
<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>