I have been trying for some days to get mono 3.0 & nginx 1.2.4 and fastcgi-mono-serverX in the XSP 2.10 package going on Centos 6.3 ...the XSP4 server works but I can't get the fastcgi method working.
I built and tested mono 3.0 from source, it works fine.
I followed the config at http://www.mono-project.com/FastCGI_Nginx to no avail and many other settings from the nginx site.
...does the current XSP 2.10 module work with mono 3.0?
...should I downgrade mono to 2.11.4 to work with XSP 2.10?
...ultimately I would like to run ASP.Net 4.0 Web Forms
Update: Here's some output from the 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.
If you use Mono 3.0, use a tag from xsp that is 3.x too. End of story.
Also, to avoid bugs like 3582, use Mono 3.0.3 or higher.
I was about to file a bug report with Xamarin... then I came across this submitted bug report from a year ago.
https://bugzilla.xamarin.com/show_bug.cgi?id=2876
tl;dr
You need to update the shell script (found with
which mono-fastcgi-server4
), and movemono-fastcgi-server4.exe
from/usr/lib/mono/4.0
to/usr/lib/mono/4.5
.Longer Explanation
As mentioned, I'm using the
mono-fastcgi-server4
package directly from the main canonical Ubuntu source which lists these file contentsBased on the bug report solution, I was able to get this working. Essentially you edit the shell script used to launch
fastcgi-mono-server4.exe
by hand (which should be in/usr/bin
), and move the .exe file by hand... or... you can use this little snippet of script that I incorporated into thedeploy:setup
of a Capistrano script. It usessed
to update the script.This report also seems related https://bugzilla.xamarin.com/show_bug.cgi?id=3582