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

Quandary quandary82 at hailmail.net
Wed May 18 08:53:01 EDT 2011


With the help of Tomasz Kubacki's project I was now able to sort out the
bugs in my project and get my ASP.NET MVC 3 project with Razor running
on Linux. It's now working fine.

The errors that were in my project were as appended bellow.

So now I have 3 questions:
1. Shouldn't mono automatically take the version of
Microsoft.Web.Infrastructure.dll that is in the gac, even when it has
been localcopied ?
2. Why does localcopying of System.Web.Extensions.dll from .NET 4
produce an error, and again, why is the gac version not automagically used ?
3. Why does referencing and localcopying
System.Web.WebPages.Administration.dll result in an error ("module
cannot be loaded"), and what's the solution if I would need to use it ?


------- Errors --------

Error:  Storage scopes cannot be created when _AppStart is executing.
Cause: Microsoft.Web.Infrastructure.dll was localcopied to the bin
directory.
Resolution: Delete Microsoft.Web.Infrastructure.dll and use the mono
version.


Error: Invalid IL code in System.Web.Handlers.ScriptModule:.ctor ():
method body is empty.
Cause: System.Web.Extensions.dll somehow gets localcopied to the bin
directory.
Resolution: Delete System.Web.Extensions.dll and use the mono version.


Error: The classes in the module cannot be loaded. Description: HTTP
500. Error processing request.
Cause: System.Web.WebPages.Administration.dll was localcopied to the bin
directory.
Resolution: Delete System.Web.WebPages.Administration.dll and unreference it


Error: Could not load type
'System.Web.WebPages.Razor.RazorBuildProvider' from assembly
'System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35'. Description: HTTP 500. Error
processing request.
Cause: System.Web.Razor.dll is corrupt or missing  ...
Resolution: Get an uncorrupted version of System.Web.Razor.dll and
localcopy to the bin directory



Kind regards


Stefan


On 05/02/2011 10:43 AM, Tomasz Kubacki wrote:
> hi,
>
> i've a running linux: mvc3 + razor with:
>
> System.Web.Mvc.dll
> System.Web.WebPages.Razor.dll
> System.Web.WebPages.dll
> System.Web.WebPages.Deployment.dll
> System.Web.Razor.dll
>
> Cheers,
>
> Tomasz Kubacki
>
> Dnia 2011-05-02, pon o godzinie 07:19 +0200, Quandary pisze: 
>> Nope, doesn't go away.
>> Besides, I don't use Entity, it was just referenced by a JQuery example
>> I integrated (with removing everything  Entity).
>>
>> On 05/01/2011 08:56 PM, Marek Habersack wrote:
>>> On Sun, 01 May 2011 18:52:21 +0200
>>> Quandary <quandary82 at hailmail.net> wrote:
>>>
>>> Hey,
>>>
>>>> Thanks Robert, that helped somewhat.
>>>> Now, the following dll's are in the bin directory:
>>>>
>>>> ls *.dll
>>>> MyProject.dll              System.Web.Routing.dll
>>>> System.Web.Entity.dll      System.Web.WebPages.Administration.dll
>>>> System.Web.Extensions.dll  System.Web.WebPages.Deployment.dll
>>>> System.Web.Helpers.dll     System.Web.WebPages.dll
>>>> System.Web.Mvc.dll         System.Web.WebPages.Razor.dll
>>> You must remove System.Web.Entity (Mono doesn't have the EntityFramework), System.Web.Extensions
>>> (it's probably a .NET assembly, Mono has its own version - the .NET one will not work with Mono),
>>> System.Web.Routing (the same - Mono has its own version, also in .NET 4.0 this assembly is
>>> practically empty since the routing classes were moved to System.Web proper)
>>>
>>>> and now I get this error on http://localhost:8080 :
>>>>
>>>>
>>>>     /Could not load type 'System.Web.WebPages.Razor.RazorBuildProvider'
>>>>     from assembly 'System.Web.WebPages.Razor, Version=1.0.0.0,
>>>>     Culture=neutral, PublicKeyToken=31bf3856ad364e35'./
>>> This might go away after you remove the assemblies I listed above.
>>>
>>>> And if I switch to http://localhost:8080/Sandbox, I get this:
>>>>
>>>>
>>>>
>>>>     /Invalid IL code in System.Web.Handlers.ScriptModule:.ctor ():
>>>>     method body is empty./
>>>>
>>>> *Description: *HTTP 500. Error processing request.
>>>>
>>>> *Stack Trace:*
>>>>
>>>> System.InvalidProgramException: Invalid IL code in System.Web.Handlers.ScriptModule:.ctor ():
>>>> method body is empty.
>>>>
>>>>   at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke
>>>> (System.Reflection.MonoCMethod,object,object[],System.Exception&) at
>>>> System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr,
>>>> System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo
>>>> culture) [0x00000] in <filename unknown>:0 
>>> This looks like a genuine bug, although let's see if removing the aforementioned assemblies helps
>>> here as well.
>>>
>>> Also, please consider upgrading your Mono to version 2.10.2 - it includes important fixes which
>>> apply to ASP.NET and related technologies.
>>>
>>> marek
>>>> On 05/01/2011 01:09 AM, Robert Jordan wrote:
>>>>> On 30.04.2011 23:08, Quandary wrote:
>>>>>> 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
>>>>>> )
>>>>> You need to copy more MS assemblies into your app's bin directory:
>>>>>
>>>>> System.Web.Mvc.dll
>>>>> System.Web.Razor.dll
>>>>> System.Web.WebPages.dll
>>>>> System.Web.WebPages.Deployment.dll
>>>>> System.Web.WebPages.Razor.dll
>>>>>
>>>>> Robert
>>>>>
>>>>> _______________________________________________
>>>>> Mono-devel-list mailing list
>>>>> Mono-devel-list at lists.ximian.com
>>>>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>> _______________________________________________
>> Mono-devel-list mailing list
>> Mono-devel-list at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>



More information about the Mono-devel-list mailing list