极有可能的一种情况是:
.net4.0中将下边这个方法替换成其它方法了,我们在写代码的时候,VS会在下边提示"此方法过旧..请用新的写法"之类的..
System.Configuration.IConfigurationSectionHandler.Create
那么就是说Mono对.net4.0不支持...但是我在用XSP来运行的时候就没有这个问题.
我的Mod_mono的配置
<IfModule !mod_mono.c>
LoadModule mono_module /usr/local/libexec/apache22/mod_mono.so
MonoServerPath "/usr/local/bin/mod-mono-server4"
MonoDebug true
MonoSetEnv MONO_IOMAP=all
MonoApplications "/:/usr/local/www/apache22/data/data"
</IfModule>
检查下你程序是否报错了
程序就是XSP的Test目录下的程序。我检查了APACHE的错误提示,有报错..错误提示是:
[Tue Jan 15 10:27:01 2013] [notice] Apache/2.2.23 (FreeBSD) mod_mono/2.10 mod_ssl/2.2.23 OpenSSL/0.9.8q DAV/2 configured -- resuming normal operations 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 <filename unknown>:0 at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0 at System.Configuration.ConfigurationManager.get_AppSettings () [0x00000] in <filename unknown>:0 at Mono.WebServer.Apache.Server.get_AppSettings () [0x00001] in /usr/ports/www/xsp/work/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:208 at Mono.WebServer.Apache.Server+ApplicationSettings..ctor () [0x0002a] in /usr/ports/www/xsp/work/xsp-2.10.2/src/Mono.WebServer.Apache/main.cs:63 mod-mono-server4 Listening on: /tmp/mod_mono_server_global Root directory: /usr/local/www/apache22/data/data Worker initialization exception occurred. Continuing anyway: System.MissingMethodException: Method not found: 'System.Configuration.IConfigurationSectionHandler.Create'. at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection (System.String configKey) [0x00000] in <filename unknown>:0 at System.Configuration.ConfigurationManager.GetSection (System.String sectionName) [0x00000] in <filename unknown>:0 at System.Configuration.ConfigurationManager.get_AppSettings () [0x00000] in <filename unknown>:0 at Mono.WebServer.ModMonoWorkerRequest..cctor () [0x00034] in /usr/ports/www/xsp/work/xsp-2.10.2/src/Mono.WebServer.Apache/ModMonoWorkerRequest.cs:85 System.NullReferenceException: Object reference not set to an instance of an object at Mono.WebServer.BaseApplicationHost.EndOfRequest (Mono.WebServer.MonoWorkerRequest mwr) [0x00029] in /usr/ports/www/xsp/work/xsp-2.10.2/src/Mono.WebServer/BaseApplicationHost.cs:141 at Mono.WebServer.ModMonoApplicationHost.ProcessRequest (Int32 reqId, System.String verb, System.String queryString, System.String path, System.String protocol, System.String localAddress, Int32 serverPort, System.String remoteAddress, Int32 remotePort, System.String remoteName, System.String[] headers, System.String[] headerValues, System.Object worker) [0x00173] in /usr/ports/www/xsp/work/xsp-2.10.2/src/Mono.WebServer.Apache/ModMonoApplicationHost.cs:109 at (wrapper remoting-invoke-with-check) Mono.WebServer.ModMonoApplicationHost:ProcessRequest (int,string,string,string,string,string,int,string,int,string,string[],string[],object) at Mono.WebServer.ModMonoWorker.InnerRun (System.Object state) [0x00199] in /usr/ports/www/xsp/work/xsp-2.10.2/src/Mono.WebServer.Apache/ModMonoWorker.cs:239 at Mono.WebServer.ModMonoWorker.Run (System.Object state) [0x00002] in /usr/ports/www/xsp/work/xsp-2.10.2/src/Mono.WebServer.Apache/ModMonoWorker.cs:92 [Tue Jan 15 10:27:07 2013] [error] (70014)End of file found: read_data failed [Tue Jan 15 10:27:07 2013] [error] Command stream corrupted, last command was -1