1

I am deploying an ASP.NET MVC 4 application on IIS 7.5 on a Windows 2008 R2 machine.

The app works alright locally in the Visual Studio Web development server.

But when deployed, I get a 504 http status code.

The app runs in a custom application pool under the ApplicationPoolIdentity identity and in Integrated mode. The app pool is enabled to run both 32-bit and 64-bit applications and targets v4 of the .NET framework.

The app assemblies were build targeting "Any CPU".

When I deploy the application and attempt to access it, in addition to receiving the 504 Http status code, I also see this in the event viewer.

Event Data
  HRESULT 0x8007000d 
  PhysicalPath \\?\C:\Windows\Microsoft.NET\Framework\v4.0.30319\CONFIG\web.config 
  Type 3 
  Message Unrecognized element 'providerOption'  
  LineNumber 53 
  PreviousLine <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">  
  ErrorLine <providerOption name="CompilerVersion" value="v4.0"/>  
  NextLine <providerOption name="WarnAsError" value="false"/>  
Water Cooler v2
  • 32,724
  • 54
  • 166
  • 336
  • Maybe this will help you: http://stackoverflow.com/questions/3314469/asp-net-4-0-how-do-i-fix-the-compilerversion-iis-error – Tassisto Jan 23 '14 at 13:12
  • Check in your web.config if the 'compiler type' string is correct. – Tassisto Jan 23 '14 at 13:13
  • The above configuration is related to `CodeDOM`, which is used by ASP.NET to generate your "code behind" classes. There is no compiler type string in my web.config. In fact, there is no `` element at all. – Water Cooler v2 Jan 23 '14 at 13:16
  • Have you tried to register ASP.Net using aspnet_regiis –i? Try that and let me know what happened. – ramiramilu Jan 23 '14 at 13:35

1 Answers1

1

The above configuration pertains to CodeDOM, a set of classes in the System.CodeDom namespace in the System.dll assembly that ASP.NET uses to generate our "code behind" classes.

The CodeDOM configuration has changed from v2 of the .NET framework to v3.5.

I missed the part where the above error gives me the path of the web.config it is complaining about. The path is C:\Windows\Microsoft.NET\Framework\v4.0.30319\CONFIG\web.config and that file did have this <providerOption> element.

I commented that out. This error is now gone.

However, I still have other issues to deal with but this one goes away. So, anyone else in the future who faces this error might use this answer as help.

Water Cooler v2
  • 32,724
  • 54
  • 166
  • 336
  • You commented out something in a core .NET framework file? I'm wondering how that worked out for you in the long run, because on the face of it that sounds like a very bad idea. – Colin P. Hill Mar 31 '15 at 19:46
  • I don't remember the specifics now but from a vague recollection, what I was trying to say was that the XML elements in the web.config that were used to tell ASP.NET to use CodeDom as the code generator had changed from version 2 to version 3.5 of the .NET framework in that they'd become implicit. That is, if you didn't have that element, it would default to some piece of code within ASP.NET that would pick up the CodeDom provider. Or some such. I could be totally wrong, though. I don't remember what it was but whatever it was made sense at the time I figured it out. Sorry. :P – Water Cooler v2 Apr 02 '15 at 02:10