我只是在我的CentOS盒子上设置mod-mono并配置Apache来提供.aspx页面,但是每当提供一个页面时它都会抛出错误。错误是:
System.IO.FileNotFoundException: Could not load file or assembly 'mod-mono-server2, Version=2.10.2.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756' or one of its dependencies. The system cannot find the file specified.
File name: 'mod-mono-server2, Version=2.10.2.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756'
at (wrapper xdomain-invoke) System.AppDomain:CreateInstanceAndUnwrap (string,string)
at (wrapper remoting-invoke-with-check) System.AppDomain:CreateInstanceAndUnwrap (string,string)
at System.Web.Hosting.ApplicationHost.CreateApplicationHost (System.Type hostType, System.String virtualDir, System.String physicalDir) [0x00000] in <filename unknown>:0
at Mono.WebServer.VPathToHost.CreateHost (Mono.WebServer.ApplicationServer server, Mono.WebServer.WebSource webSource) [0x00000] in <filename unknown>:0
at Mono.WebServer.ApplicationServer.GetApplicationForPath (System.String vhost, Int32 port, System.String path, Boolean defaultToRoot) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) Mono.WebServer.ApplicationServer:GetApplicationForPath (string,int,string,bool)
at Mono.WebServer.ModMonoWorker.GetOrCreateApplication (System.String vhost, Int32 port, System.String filepath, System.String virt) [0x00000] in <filename unknown>:0
at Mono.WebServer.ModMonoWorker.InnerRun (System.Object state) [0x00000] in <filename unknown>:0
at Mono.WebServer.ModMonoWorker.Run (System.Object state) [0x00000] in <filename unknown>:0
我的单字母前缀为/opt/mono
。如果我手动运行/opt/mono/bin/mod-mono-server2
它会抛出相同的错误(它怎么能找不到自己?)。有关如何解决此问题的任何想法?应该注意的是,我在/usr/local
中安装了并行单声道,但/opt/mono
中首先PATH
。
编辑:我使用详细日志记录运行/opt/mono/bin/mod-mono-server2
,我可以看到AOT尝试加载库并失败。以下是日志的粘贴:http://hastebin.com/cijubibefe.log
其中许多库没有共享目标文件。例如,/opt/mono/lib/mono/gac/System/2.0.0.0__b77a5c561934e089/System.dll
存在(与System.dll.mdb
一起),但/opt/mono/lib/mono/gac/System/2.0.0.0__b77a5c561934e089/System.dll.so
不存在。
我只是想通了。不知何故,当我构建Mono,XSP和mod-mono时,我的前缀没有被用于部分构建序列,并且mod-mono-server2
等可执行文件的启动脚本与/usr/local/bin/mono
一起运行而不是/opt/mono/bin/mono
,显然在GAC中没有mod-mono-server2。编辑所有启动脚本以使用/opt/mono/bin/mono
解决了问题。