[Mono-dev] ASP.NET MVC 3 with Razor on Mono 2.10.1 ?

Quandary quandary82 at hailmail.net
Sat Apr 30 17:08:21 EDT 2011


Hi,

I'm trying to get ASP.NET MVC3 with Razor to run on Linux.
I localcopied all necessary dll's
(
System.Web.Helpers.dll
System.Web.Mvc.dll
System.Web.Razor.dll
System.Web.WebPages.dll
)

and referenced them in the mono project.
I recompiled (recompilation went fine)

but the page execution ends with this:
Server Error in '/' Application

Could not load file or assembly 'System.Web.WebPages.Razor,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or
one of its dependencies.

Description: HTTP 500. Error processing request.

Stack Trace:

System.IO.FileNotFoundException: Could not load file or assembly
'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35' or one of its dependencies.
File name: 'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35'
  at (wrapper managed-to-native)
System.Reflection.MonoMethod:InternalInvoke
(System.Reflection.MonoMethod,object,object[],System.Exception&)
  at System.Reflection.MonoMethod.Invoke (System.Object obj,
BindingFlags invokeAttr, System.Reflection.Binder binder,
System.Object[] parameters, System.Globalization.CultureInfo culture)
[0x000d5] in
/root/sources/mono/2.10/mono-2.10.1/mcs/class/corlib/System.Reflection/MonoMethod.cs:226

Version information: Mono Runtime Version: 2.10.1 (tarball Sun Mar 6
21:19:00 CET 2011); ASP.NET Version: 4.0.30319.1




If I let xsp4 run standalone instead of in monodevelop, i get a little
bit better error message:

mono xsp4
Listening on address: 0.0.0.0
Root directory: /root/Projects/MyProject/MyProject
Listening on port: 8080 (non-secure)
Hit Return to stop the server.
Missing method Start in assembly
/tmp/root-temp-aspnet-0/3bfdc417/assembly/shadow/133f36d7/53313c15_400e0ac2_00000001/System.Web.Mvc.dll,
type System.Web.WebPages.Razor.PreApplicationStartCode




I assumed this is because it takes the Mvc.dll delivered with mono in
the GAC instead of the localcopy ?
So I tried to add Razor.dll and System.Web.Mvc to the GAC.
But when I tried, I got this error messages:

gacutil -i System.Web.Razor.dll
Failure adding assembly System.Web.Razor.dll to the cache: Strong name
cannot be verified for delay-signed assembly


gacutil -i System.Web.Mvc.dll
Failure adding assembly System.Web.Mvc.dll to the cache: Strong name
cannot be verified for delay-signed assembly




How can I add them to the GAC ?
Or is there any other way to get it working ?


Kind regards


Stefan



More information about the Mono-devel-list mailing list