Error publishing C# MVC project, Could not load file or Assembly 'System.Web.Http.Webhost

Asked

Viewed 1,329 times

0

I have a C# MVC project, that running in Visual Studio 2013, works, but when I go up to the server 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 cannot find the file specified.

Error after solution displayed

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" />
  • Which hosting provider? Locaweb, kinghost?

  • smarterasp.net, I have other applications hosted there without any problem. I was having trouble opening the project in two different machines, because I asked for MVC 4.0.0.1 in one and the other had only 4.0.0.0

  • Complete error http://app.sesmt.com.br/

1 answer

3


The problem is that the DLL is not being copied to the server when publishing.

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

  • What do you mean by "within the project"? What project? Where would that be? There’s no way to do it in the direct setup on IIS?

  • @franzisk No file csproj. Has, just copy the DLL there, now if it’s a good idea I can no longer guarantee...

  • It is a project that has been copied some files from a system that is in production and placed in a folder on the server and we are trying to go up by configuring directly in IIS (Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3429.0)so I would like to know how to solve directly or on the web.config or IIS dashboard

Browser other questions tagged

You are not signed in. Login or sign up in order to post.