Problems Running an MVC3 site

Discussion in 'General troubleshooting' started by johnnynibbles, Mar 27, 2011.

  1. I have been attempting to release an ASP.NET MVC3 application to Winhost and have run into a problem where assemblies seem to be missing. I create an empty MVC 3 project and published this an got an error from the config. Any help would be appreciated.

    Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

    Parser Error Message: Could not load file or assembly 'System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

    Source Error:


    Line 21: <assemblies>
    Line 22: <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    Line 23: <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    Line 24: <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    Line 25: <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
     
    Last edited by a moderator: Oct 14, 2015
  2. Ray

    Ray

    Make sure you uploaded the MVC assemblies in your applications Bin folder.
     
  3. I thought these files would have been hosted on the server as by default they aren't included in the bin folder. I found that there are a lot of files missing. I was finally able to get it working if I manually copied:
    System.Web.WebPages.Razor.dll
    System.Web.WebPages.Deployment.dll
    System.Web.Razor.dll
    System.Web.Mvc.dll
    System.Web.Helpers.dll
    Microsoft.Web.Infrastructure.dll

    It is a little strange that these need to be manually copied into the bin folder. Is there an easier way of doing this that I am missing? I tried setting the references to create a local copy but the only worked for a couple of the files.

    Thanks for you help,
    John
     
  4. Ray

    Ray

    Microsoft appears to be upgrading MVC so keeping up with the assembly version can be labor intensive. That is why we decided to not install it on the servers GAC. But because MVC is Bin deployable, there should be no problem with the application if you simply upload it to your applications Bin folder.
     
  5. For those new to all of this:

    This means goto your references in the solution explorer (top right pane in Visual Studio)
    Change the property "Copy Local" to true for the following references:
    System.Web.Helpers
    System.Web.MVC
    System.Web.WebPages

    Add the following references and perform the above "copy local" step:
    Microsoft.Web.Infrastructure
    System.Web.Razor
    System.Web.WebPages.Razor
    System.Web.WebPages.Deployment

    Re-deploy and (hopefully) volia
     
  6. Ray

    Ray

    Thanks for that post. That should save a lot of people from a lot of frustration.
     
  7. Hello,

    Where can I find NuGet packages for MVC 3? Is it also possible to deploy MVC 4 , .Net 4.0 application? Any experience with it? Thanks.
     

Share This Page