无法使用mod_mono托管ASP.NET MVC 4应用程序

无法使用mod_mono托管ASP.NET MVC 4应用程序,asp.net,asp.net-mvc-4,mono,debian,mod-mono,Asp.net,Asp.net Mvc 4,Mono,Debian,Mod Mono,我正试图用mod_mono在apache中托管一个ASP.NET MVC 4应用程序,但我一直收到以下错误: 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.GetCustomEncoderF

我正试图用mod_mono在apache中托管一个ASP.NET MVC 4应用程序,但我一直收到以下错误:

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 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/nishkriya/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 ---
应用程序设置为使用/usr/local/bin/mod\u mono\u server4,它指向

exec /usr/local/bin/mono $MONO_OPTIONS "/usr/local/lib/mono/4.5/mod-mono-server4.exe" "$@"

谢谢

这听起来像是个糟糕的安装。您是否在/usr/bin(除了/usr/local/bin)中安装了其他mono?如果是,那么你应该擦干净盒子,然后重新开始,但这次看看这个。

你可以在mono Jexus上尝试另一个asp.net web服务器,它支持asp.net MVC 4应用程序

exec /usr/local/bin/mono $MONO_OPTIONS "/usr/local/lib/mono/4.5/mod-mono-server4.exe" "$@"