我在Apache中使用mod-mono託管ServiceStack Web服務,我有mono-3.0.0,和xsp-2.10.2。 我主辦了以.Net framework 2.0爲目標的hello world示例,並使用mod-mono-server2,並且它工作正常。 然後,我將項目更改爲.Net Framework 4.0並使用mod-mono-server4。 我得到這個錯誤:單聲道3.0.0:無法加載文件或程序集:System.Web.Extensions.dll,版本= 4.0.0.0
Could not load file or assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
System.IO.FileNotFoundException: Could not load file or assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. File name: 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' at System.AppDomain.Load (System.String assemblyString, System.Security.Policy.Evidence assemblySecurity, Boolean refonly) [0x00000] in :0 at System.AppDomain.Load (System.String assemblyString) [0x00000] in :0 at (wrapper remoting-invoke-with-check) System.AppDomain:Load (string) at System.Reflection.Assembly.Load (System.String assemblyString) [0x00000] in :0 at System.Web.Compilation.BuildManager.LoadAssembly (System.Web.Configuration.AssemblyInfo info, System.Collections.Generic.List`1 al) [0x00000] in :0 at System.Web.Compilation.BuildManager.GetReferencedAssemblies() [0x00000] in :0 at System.Web.Compilation.BuildManager.CallPreStartMethods() [0x00000] in :0
但文件System.Web.Extensions程序安裝在GAC:
gacutil -l System.Web.Extensions
The following assemblies are installed into the GAC: System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 Number of items = 3
即使我設置MonoPath專門拿到4.0版本,則會出現同樣的錯誤:
MonoPath /usr/local/lib/mono/4.0
我也注意到了這一點:
Version information: Mono Runtime Version: 2.10.5 (tarball Fri Oct 28 10:20:24 IST 2011); ASP.NET Version: 4.0.30319.1
單聲道運行時版本說2.10.5,雖然我已安裝mono-3.0.0,我不知道這個信息是否對這個問題有價值。
我試圖直接運行MOD-單服務器4,我得到這個錯誤信息:
mod-mono-server4
mod-mono-server4 Missing method System.Configuration.IConfigurationSectionHandler::Create(object,object,XmlNode) in assembly /usr/local/lib/mono/4.0/System.dll, referenced in assembly /usr/local/lib/mono/4.0/System.Configuration.dll Exception caught during reading the configuration file: System.MissingMethodException: Method not found: 'System.Configuration.IConfigurationSectionHandler.Create'. at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00000] in :0 at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in :0 at System.Configuration.ConfigurationManager.get_AppSettings() [0x00000] in :0 at Mono.WebServer.Apache.Server.get_AppSettings() [0x00000] in :0 at Mono.WebServer.Apache.Server+ApplicationSettings..ctor() [0x00000] in :0 mod-mono-server4 Listening on: /tmp/mod_mono_server Root directory: /usr/local/bin Error: There's already a server listening on /tmp/mod_mono_server
我用Google搜索這個錯誤,它使我這個錯誤:
也許錯誤在mod-mono-server4上是另一個bug的起源......我將嘗試獲取xsp 3.0並查看它是否解決了這個問題。
任何想法?
感謝
你是如何安裝Mono 3.0的?對我來說,它看起來像你從源代碼編譯,但配置了錯誤的前綴。 –
我遵循這個指示:http://wiki.phonicuk.com/Installing-Mono-in-CentOS-5-x.ashx我剛剛改變了「mono-2.10.8.tar.gz」for「mono-3.0.0 .tar.bz2「 –
您應該關心'./configure --prefix =/usr/local'部分。執行'whereis mono'命令並查看第一個前綴是什麼。 '/ usr'也許?在這種情況下,再次使用已獲得的前綴執行此過程。之後運行'mono --version'確定。 –