Server error in application '/' System.Web.Http.WebHost

I am trying to publish an ASP.NET MVC 4 internet application. After it has been published, I go ahead and click a link for my site and I find this:

Server error in application "/".

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

Description: An unhandled exception was thrown during the execution of the current web request. Review the stack trace for more information about the error and how it occurs in your code.

Exception Details: System.IO.FileNotFoundException: Could not load file or assembly 'System.Web.Http, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Source error:

An unhandled exception was thrown during the execution of the current web request. Information about the origin and location of an exception can be identified using the exception stack trace below.

Loading load image: The following information may be helpful in determining why the assembly "System.Web.Http, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35" could not be loaded.

WRN: Assembly binding registration is disabled. To enable Build Failure Logging, set the registry value [HKLM \ Software \ Microsoft \ Fusion! EnableLog] (DWORD) to 1. Note. There is some performance limitation related to the assembly binding failure protocol. To disable this feature, delete the registry value [HKLM \ Software \ Microsoft \ Fusion! EnableLog].

Stack trace:

[FileNotFoundException: Could not load file or assembly "System.Web.Http, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35" or one of its dependencies. The system cannot find the file specified.] ProyectoFinal.MvcApplication.Application_Start () in c: \ Users \ EAGUILARCO \ Documents \ Visual Studio 2012 \ Projects \ ProyectoFinal \ ProyectoFinal \ Global.asax.cs: 26

[HttpException (0x80004005): Could not load file or assembly "System.Web.Http, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35" or one of its dependencies. The system cannot find the file specified.] System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode (HttpContext context, HttpApplication application) +9916613 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS (IntPtrHttp: AppContext handlers) [IntPtrttr. .InitSpecial (HttpApplicationState, MethodInfo [] handlers, IntPtr application context, HttpContext context) +172 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance (IntPtr application context, HttpContext context) +336 System.Webline.Hosting.timeInitializeApplication (IntPtr appContext) +296

[HttpException (0x80004005): Could not load file or assembly "System.Web.Http, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35" or one of its dependencies. The system cannot find the file specified.] System.Web.HttpRuntime.FirstRequestInit (HttpContext context) +9930508 System.Web.HttpRuntime.EnsureFirstRequestInit (HttpContext context) +101 System.Web.HttpRuntime.ProcessRequest + IWeb.Web.HttpRuntime.ProcessRequest + IstotificationContext context)

What I have tried so far:

  • Modify the registry failed. Also, I'm not sure if this will solve my problem.
  • Set the 'System.Web.Http.WebHost Copy Local' property to 'true'. It also didn't fix the problem.

Update: System.Web.Http.WebHost version 4.0.20710.0

+3


source to share


1 answer


The problem is finding the deployed assembly in the bin folder.

Check your bin folder - it should contain the System.Web.Http.WebHost file.



If this DLL is in this folder, check the version by right clicking on the file and then properties.

If it is not 4.0.0.0, you should deploy version 4.0.0.0 or try right-clicking the link in your project and make sure the Specific Version property is set to false.

+8


source







All Articles