views:

1343

answers:

4

Trying to get MVC running on Mono 2.4 (which is possible, according to some threads here) without much luck. I can't get past this:

Compilation Error

Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.

Compiler Error Message: : ** (/usr/local/lib/mono/2.0/gmcs.exe:5232): WARNING **: The class System.Web.Management.WebRequestErrorEvent could not be loaded, used in System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
~/Global.asax

Show Detailed Compiler Output: //etc

I've added System.Web.dll (and literally every reference in the project) to the bin folder - still no go.

Any ideas?

LINKS:

Miguel de Icaza saying it's possible: Twitter SO 1 SO 2

A: 

What about any DLLs that System.Web references.

Jonathan Parker
A: 

According to the mono status page for System.Web, the mentioned class isn't implemented yet. Maybe you could include a link to the threads that say it is possible to get it running?

Erik Hesselink
Added links; I'm compiling from SVN at the moment... hopefully this will work.
hb
A: 

I have no idea of ASP.NET MVC or Mono.

But, it looks like the DLL should be in GAC or similar place (not sure what terminology is used in case of Mono). The DLL has publickeytoken, which makes it a candidate for GAC.

Does this help?

shahkalpesh
+6  A: 

You shouldn't need to compile MVC (or Mono), but you will need at Mono 2.4, which is available on the Mono download site.

The only DLL you need is the System.Web.Mvc.dll. The easiest way to handle this in VS would be to set "Copy Local" to true for that assembly. Don't copy local any of the other System.* references.

Joseph Hill
Already tried with only that dll - same error. Will try again though.
hb
I tested this with the Mono 2.4 / openSUSE 11.1 VMWare image from the Mono site. It already has all of Mono installed and configured. If you're really missing System.Web on your machine, you may need to make sure you installed all dependencies. Do any other ASP.NET apps work with the xsp2 command?
Joseph Hill
Yeah, normal ASP.NET works. Does mono need any additional configure parameters to make this work? >> WARNING **: The class System.Web.Management.WebRequestErrorEvent could not be loaded, used in System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
hb
Update: the site works under xsp2; not under fastcgi-mono-server2 or mod_mono
hb
Woot, it's working now. For some reason it wasn't executing the right mono server... had to kill everything *mono* and then restart apache. Go figure.
hb
Excellent! That's great to hear. Best of luck with your MVC app.
Joseph Hill
Hrm. It only runs on XSP2; mod_mono's giving me a couple problems due to AutoHosting :(
hb
I just tested this on the same openSUSE image using AutoHosting, and that worked fine, too...maybe your mod_mono is configured to use the mod-mono-server instead of mod-mono-server2 on the default instance?
Joseph Hill
joseph.hill: that is confirmed! It runs without issues on Mono 2.4 if System.Web.Mvc is set to Copy-Local. The only issue I've faced is with VB-based projects. They seem not to be working at all. C# version of the File->New application works like a charm!
Matthias Hryniszak
matthias-hryniszak: sorry I didn't see your response sooner. It's better to fully precompile VB-based projects on Windows before deploying them to Mono (i.e., publish them as non-updatable web sites). Because MVC applications are not "web site" project types, though, you can't do this from within the IDE. Instead, use aspnet_compiler.exe from the VS 2008 command prompt. For example:aspnet_compiler -f -p c:\test\VbMvcApp -v /VbMvcApp c:\test\output
Joseph Hill