We are deploying our ASP.Net MVC application to a windows 2008 R2 server, running IIS 7.5.
After deployment, we get this error in the event log (we also get an email) : "Unrecognized element 'providerOption'" on line x in c:\wwwroot\web.config which is:
<providerOption name="CompilerVersion" value="v3.5">
located in the system.codedom compiliers section of our standard web config. I investigated the problem a bit. (I also checked the namespace details on msdn to find out abit about it). Amongst many other solutions, I found this post recommending updating the FX_Schema.xml file on our server. (I think this is where the problem is, please correct me if I'm mistaken)
I looked through fx_schema file, and, as defined in the event viewer, the attribute "providerOption" is not in this schema! Here is the copy of the system.codedom section from the FX_schema.xml
<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 can not be the the only person who has this problem, but has anyone else anyone come across this before and found a solution?
EDIT: Another way to produce this quickly is (on IIS 7 in Windows 7)
In IIS Managment console, open your MVC website, in the website home. You should see ASP.NET, IIS, and Managment groups. Under Management, open the "Configuration Editor". I get the error message popping up here!
EDIT: My copy of the web config:
<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>
</system.codedom>