Error publishing project C # MVC, could not load file or assembly 'System.Web.Http.WebHost

0

I have a C # project in MVC, which running in Visual Studio 2013, works, but when I upload to the server it gives this error:

  

Could not load file or assembly 'System.Web.Http.WebHost, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35' or one of its dependencies. The system can not find the specified file.

Error after solution rendered

  

Server Error in '/' Application.

     

Compilation Error

     

Description: An error occurred during the compilation of a resource   required to service this request. Please review the following specific   error details and modify your source code appropriately.

     

Compiler Error Message: CS0234: The type or namespace name 'Helpers'   does not exist in the namespace 'System.Web' (are you missing an   assembly reference?)

Line 32:     <pages>
Line 33:       <namespaces>
Line 34:         <add namespace="System.Web.Helpers" />
Line 35:         <add namespace="System.Web.Mvc" />
Line 36:         <add namespace="System.Web.Mvc.Ajax" />
    
asked by anonymous 10.12.2015 / 14:54

1 answer

3

The problem is that the DLL is not being copied to the server at the time of publishing.

Within the project, click References , select this DLL, right-click, and Properties . Change Copy Local to true and publish the application again.

    
10.12.2015 / 15:01