Bug 13002 - targetFramework="4.5" not recognized for httpRuntime section
Summary: targetFramework="4.5" not recognized for httpRuntime section
Alias: None
Product: Runtime
Classification: Mono
Component: General (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2013-07-02 06:03 UTC by Erik Schierboom
Modified: 2018-01-18 22:23 UTC (History)
3 users (show)

See Also:
Is this bug a regression?: ---
Last known good build:


Description Erik Schierboom 2013-07-02 06:03:05 UTC
I have created an almost empty ASP.NET MVC 4 application that I am trying to run under Mono. However, the Web.config file that was generated by Visual Studio fails to be correctly parsed leading to the following exception being thrown when running the application:

The actual exception which was being reported was:
System.Web.HttpException: Initial exception ---> System.Configuration.ConfigurationErrorsException: Error deserializing configuration section httpRuntime: Unrecognized attribute 'targetFramework'. (/var/www/sites/erik/mvctest/Web.config line 1)
at System.Configuration.ConfigurationSection.DeserializeSection (System.Xml.XmlReader reader) [0x00000] in <filename unknown>:0
at System.Configuration.Configuration.GetSectionInstance (System.Configuration.SectionInfo config, Boolean createDefaultInstance) [0x00000] in <filename unknown>:0
at System.Configuration.ConfigurationSectionCollection.get_Item (System.String name) [0x00000] in <filename unknown>:0
at System.Configuration.Configuration.GetSection (System.String path) [0x00000] in <filename unknown>:0
at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName, System.String path, System.Web.HttpContext context) [0x00000] in <filename unknown>:0
at System.Web.Configuration.WebConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0
at System.Web.HttpRuntime..cctor () [0x00000] in <filename unknown>:0
--- End of inner exception stack trace ---
An exception has occurred while generating HttpException page:
System.NullReferenceException: Object reference not set to an instance of an object
at System.Web.Util.HttpEncoder.GetCustomEncoderFromConfig () [0x00000] in <filename unknown>:0
at System.Lazy`1[System.Web.Util.HttpEncoder].InitValue () [0x00000] in <filename unknown>:0 

The culprit is the following line in the Web.config file:

<httpRuntime targetFramework="4.5" />

If I remove that line, everything works fine. I have checked if I was perhaps running an older version of the Mono runtime, but it does appear that I am using the correct version:

Version Information: 3.0.12 (tarball Tue Jul 2 10:40:28 CEST 2013); ASP.NET Version: 4.0.30319.17020
Comment 1 Ludovic Henry 2018-01-18 22:23:33 UTC
We do not support ASP.NET anymore. If you can reproduce with latest version of Mono, please reopen and provide a reproduction case. Thank you.

Note You need to log in before you can comment on or make changes to this bug.