首页 新闻 会员 周边 捐助

Freebsd9.0+Apache2.2.23+Mod_mono2.10+mono3.0.3运行asp.net4.0报500错误

0
悬赏园豆:200 [已解决问题] 解决于 2013-01-16 13:18

在运行asp.net2.0程序的时候没有问题,但是运行asp.net4.0报500错误。

@H的主页 @H | 初学一级 | 园豆:31
提问于:2013-01-15 08:50
< >
分享
最佳答案
0

极有可能的一种情况是:

.net4.0中将下边这个方法替换成其它方法了,我们在写代码的时候,VS会在下边提示"此方法过旧..请用新的写法"之类的..

System.Configuration.IConfigurationSectionHandler.Create




收获园豆:150
hexllo | 菜鸟二级 |园豆:318 | 2013-01-15 11:31

那么就是说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>

@H | 园豆:31 (初学一级) | 2013-01-15 12:49
其他回答(2)
0

检查下你程序是否报错了

收获园豆:50
az235 | 园豆:8483 (大侠五级) | 2013-01-15 09:18

程序就是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
支持(0) 反对(0) @H | 园豆:31 (初学一级) | 2013-01-15 10:28
0

原来是XSP的问题,需要到https://github.com/mono/xsp下载xsp-master然后编译安装就可以了....

参考wang_yb--在Linux上部署aspnet mvc3

@H | 园豆:31 (初学一级) | 2013-01-16 13:17
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册