Mono 3.2.1 MVC 4 (XSP) System.Web.Mvc assembly trouble

1.1k Views Asked by At


I was trying to deploy .NET 4.5 MVC4 project to the Mono 3.2 XSP and got exception.

Software:

  • Ubuntu Linux 13.04
  • Mono 3.2.1 compiled from sources
  • XSP4 3.0.11 compiled from sources
  • Exception text:

    CS1701: Warning as Error: Assuming assembly reference `System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' matches assembly `System.Web.Mvc, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. You may need to supply runtime policy
    

    Stack trace:

    at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.Web.VirtualPath virtualPath,     System.CodeDom.Compiler.CompilerParameters options) [0x00000] in <filename unknown>:0 
    at System.Web.Compilation.AssemblyBuilder.BuildAssembly (System.CodeDom.Compiler.CompilerParameters options) [0x00000] in <filename unknown>:0 
    at System.Web.Compilation.AppResourcesAssemblyBuilder.BuildDefaultAssembly (System.Collections.Generic.List`1 files, System.CodeDom.CodeCompileUnit unit) [0x00000] in <filename unknown>:0 
    at System.Web.Compilation.AppResourcesAssemblyBuilder.Build (System.CodeDom.CodeCompileUnit unit) [0x00000] in <filename unknown>:0 
    at System.Web.Compilation.AppResourcesCompiler.CompileGlobal () [0x00000] in <filename unknown>:0 
    at System.Web.Compilation.AppResourcesCompiler.Compile () [0x00000] in <filename unknown>:0 
    at System.Web.HttpApplicationFactory.InitType (System.Web.HttpContext context) [0x00000] in <filename unknown>:0 
    

    Anybody solved it? How to get rid of it?

    1

    There are 1 best solutions below

    0
    On

    I've found that the only way of getting an MVC3 project working on Mono was by copying some of the Microsoft assemblies to the Mono project, such as (if using Razor):

    • System.Web.Mvc
    • System.Web.Razor
    • System.Web.Helpers
    • System.Web.WebPages.Deployment
    • System.Web.WebPages
    • System.Web.WebPages.Razor

    Being you're using MVC4 it'll probably be something along the same lines - it's what the exception seems to be hinting (its seeing version 1 and expecting 4). Chances are you'll need different or additional assemblies to these. Have a look here, you might find some additional help.

    Also, .NET 4.5 is still not fully supported on Mono (no async on MVC4). Expect to find other problems there.