我正在使用mod-mono在Apache中托管一个ServiceStack Web服务,我的mono版本是3.0.0,xsp版本是2.10.2。 我使用mod-mono-server2托管了一个目标为.NET Framework 2.0的hello world示例,并且它工作正常。 然后我将项目更改为目标为.NET Framework 4.0并使用mod-mono-server4。 我遇到了这个错误:
无法加载文件或程序集“System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”中的一个或多个依赖项。系统找不到指定的文件。System.IO.FileNotFoundException: 无法加载文件或程序集“System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”中的一个或多个依赖项。系统找不到指定的文件。文件名:“System.Web.Extensions,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35”。在 System.AppDomain.Load (System.String assemblyString,System.Security.Policy.Evidence assemblySecurity,Boolean refonly) [0x00000] in :0 在 System.AppDomain.Load (System.String assemblyString) [0x00000] in :0 在 (wrapper remoting-invoke-with-check) System.AppDomain:Load (string) 在 System.Reflection.Assembly.Load (System.String assemblyString) [0x00000] in :0 在 System.Web.Compilation.BuildManager.LoadAssembly (System.Web.Configuration.AssemblyInfo info,System.Collections.Generic.List`1 al) [0x00000] in :0 在 System.Web.Compilation.BuildManager.GetReferencedAssemblies () [0x00000] in :0 在 System.Web.Compilation.BuildManager.CallPreStartMethods () [0x00000] in :0但是System.Web.Extensions文件已安装在GAC中:
gacutil -l System.Web.Extensions
以下程序集已安装到GAC中: System.Web.Extensions,版本=1.0.61025.0,文化=中性,公钥令牌=31bf3856ad364e35 System.Web.Extensions,版本=3.5.0.0,文化=中性,公钥令牌=31bf3856ad364e35 System.Web.Extensions,版本=4.0.0.0,文化=中性,公钥令牌=31bf3856ad364e35 项目数=3
即使我将MonoPath设置为专门获取4.0版本,仍会出现相同的错误:
MonoPath /usr/local/lib/mono/4.0
我还注意到这一点:
虽然我安装了mono-3.0.0,但Mono运行时版本显示为2.10.5,我不知道这个信息对这个问题是否有价值。版本信息:Mono运行时版本:2.10.5(tarball Fri Oct 28 10:20:24 IST 2011); ASP.NET版本:4.0.30319.1
我尝试直接运行mod-mono-server4,但出现了以下错误消息:
mod-mono-server4
mod-mono-server4 在程序集 /usr/local/lib/mono/4.0/System.dll 中找不到方法 System.Configuration.IConfigurationSectionHandler::Create(object,object,XmlNode),但在程序集 /usr/local/lib/mono/4.0/System.Configuration.dll 中被引用。 在读取配置文件时遇到异常: System.MissingMethodException: 找不到方法:'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 正在监听:/tmp/mod_mono_server 根目录:/usr/local/bin 错误:已经有一个服务器正在监听 /tmp/mod_mono_server
我搜索了这个错误,发现了这个 bug:
也许 mod-mono-server4 的错误是其他 bug 的根源...我将尝试获取 xsp 3.0 并查看是否解决了问题。
有任何想法吗?
谢谢
./configure --prefix=/usr/local
部分。执行whereis mono
命令并查看第一个前缀是什么。也许是/usr
?如果是这样,请使用您获得的前缀再次执行该过程。之后运行mono --version
确认一下。 - konrad.kruczynski