2013-04-06 31 views
3

我想在是mod_mono阿帕奇主辦的ASP.NET MVC應用4,但我不斷收到以下錯誤舉辦ASP.NET MVC 4應用程序:無法使用是mod_mono

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

我編單和來自源的mod_mono。

[email protected] ~# mono --version 
Mono JIT compiler version 3.0.7 ((no/514fcd7 Thu Mar 21 22:55:42 GMT 2013) 
Copyright (C) 2002-2012 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com 
    TLS:   __thread 
    SIGSEGV:  altstack 
    Notifications: epoll 
    Architecture: amd64 
    Disabled:  none 
    Misc:   softdebug 
    LLVM:   supported, not enabled. 
    GC:   Included Boehm (with typed GC and Parallel Mark) 

的應用程序設置爲使用/ usr/local/bin目錄/ mod_mono_server4指向

exec /usr/local/bin/mono $MONO_OPTIONS "/usr/local/lib/mono/4.5/mod-mono-server4.exe" "[email protected]" 

感謝

回答

0

這聞起來像一個壞的安裝。/usr/bin(除/ usr/local/bin之外)是否安裝了另一個mono?如果是的話,那麼你應該擦拭你的盒子並重新開始,但這次看着這個guide