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 ()
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)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

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.