fastcgi-mono-serverX可以与mono 3.0& nginx 1.2.4

时间:2012-11-05 19:38:16

标签: mono

我已经尝试了几天获得单声道3.0&在Centos 6.3上运行的XSP 2.10软件包中的nginx 1.2.4和fastcgi-mono-serverX ... XSP4服务器可以工作,但我无法使fastcgi方法正常工作。

我从源代码构建并测试了mono 3.0,它工作正常。

我按照http://www.mono-project.com/FastCGI_Nginx处的配置,无法使用nginx网站上的其他设置。

...当前的XSP 2.10模块是否与单声道3.0配合使用? ...我应该将mono降级到2.11.4以使用XSP 2.10吗? ...最终我想运行ASP.Net 4.0 Web Forms

更新:这是mono-server.log的一些输出:

    Server stack trace: 
  at Mono.WebServer.FastCgi.ApplicationHost.ProcessRequest (Mono.WebServer.FastCgi.Responder responder) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) Mono.WebServer.FastCgi.ApplicationHost:ProcessRequest (Mono.WebServer.FastCgi.Responder)
  at (wrapper xdomain-dispatch) Mono.WebServer.FastCgi.ApplicationHost:ProcessRequest (object,byte[]&,byte[]&)

Exception rethrown at [0]: 
 ---> System.InvalidCastException: Cannot cast from source type to destination type.
  at System.Configuration.ConfigurationManager.get_AppSettings () [0x00000] in <filename unknown>:0 
  at Mono.WebServer.FastCgi.WorkerRequest..cctor () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at (wrapper xdomain-invoke) Mono.WebServer.FastCgi.ApplicationHost:ProcessRequest (Mono.WebServer.FastCgi.Responder)
  at (wrapper remoting-invoke-with-check) Mono.WebServer.FastCgi.ApplicationHost:ProcessRequest (Mono.WebServer.FastCgi.Responder)
  at Mono.WebServer.FastCgi.Responder.Process () [0x00000] in <filename unknown>:0 
[2012-11-05 12:35:14Z] Error   Failed to process connection. Reason: The object was used after being disposed.

2 个答案:

答案 0 :(得分:3)

我准备向Xamarin提交错误报告......然后我在一年前发现了这个提交的错误报告。

https://bugzilla.xamarin.com/show_bug.cgi?id=2876

TL;博士

您需要更新shell脚本(在which mono-fastcgi-server4找到),并将mono-fastcgi-server4.exe/usr/lib/mono/4.0移至/usr/lib/mono/4.5

更长的解释

如上所述,我直接使用主要规范Ubuntu source中的mono-fastcgi-server4包列出了这些文件内容

/usr/bin/fastcgi-mono-server4
/usr/lib/mono/4.0/fastcgi-mono-server4.exe
/usr/lib/mono/gac/fastcgi-mono-server4/2.10.0.0__0738eb9f132ed756/fastcgi-mono-server4.exe
/usr/share/doc/mono-fastcgi-server4/AUTHORS
/usr/share/doc/mono-fastcgi-server4/NEWS.gz
/usr/share/doc/mono-fastcgi-server4/README
/usr/share/doc/mono-fastcgi-server4/README.Debian
/usr/share/doc/mono-fastcgi-server4/changelog.Debian.gz
/usr/share/doc/mono-fastcgi-server4/copyright
/usr/share/man/man1/fastcgi-mono-server4.1.gz

根据错误报告解决方案,我能够实现这一点。基本上你编辑用于手动启动fastcgi-mono-server4.exe的shell脚本(应该在/usr/bin中),并手动移动.exe文件......或者......你可以使用这个小片段我在Capistrano脚本的deploy:setup中加入的脚本。它使用sed来更新脚本。

fastcgi=$(which fastcgi-mono-server4) &&
sudo sed -i.bak -e 's/4\\.0/4.5/' $fastcgi &&
fastcgi_src='/usr/lib/mono/4.0/fastcgi-mono-server4.exe' &&
fastcgi_dest='/usr/lib/mono/4.5/fastcgi-mono-server4.exe' &&
if [ -f "$fastcgi_src" ]; then sudo mv $fastcgi_src $fastcgi_dest; fi;

此报告似乎也有关系 https://bugzilla.xamarin.com/show_bug.cgi?id=3582

答案 1 :(得分:3)

如果您使用的是Mono 3.0,请使用xsp中也是3.x的标记。故事结束。

另外,为了避免像3582这样的错误,请使用Mono 3.0.3或更高版本。