无法加载文件或程序集“System.Web.Http.WebHost,版本= 4.0.0.0,文化=中性公钥= 31bf3856ad364e35' [英] Could not load file or assembly 'System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral,PublicKeyToken=31bf3856ad364e35'

查看:1670
本文介绍了无法加载文件或程序集“System.Web.Http.WebHost,版本= 4.0.0.0,文化=中性公钥= 31bf3856ad364e35'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Visual Studio 2012我创建了一个ASP.NET MVC 4项目中,目标框架是.NET Framework 4.5。当我部署了我的项目到Web服务器它给了以下错误:

 无法加载文件或程序集System.Web.Http.WebHost,版本= 4.0.0.0,文化=中立,
公钥= 31bf3856ad364e35或它的一个依赖。系统无法找到文件
指定。说明:执行当前Web请求的执行过程中发生未处理的异常。
 请检查堆栈跟踪有关该错误以及更多信息
它起源于code。异常详细信息:System.IO.FileNotFoundException:未能加载文件或程序
集System.Web.Http.WebHost,版本= 4.0.0.0,文化=中立,
 公钥= 31bf3856ad364e35或它的一个依赖。
 该系统找不到指定的文件。源错误:
版本信息:Microsoft .NET Framework版本:4.0.30319; ASP.NET版本:4.0.30319.34237


解决方案

检查您的部署项目的bin文件夹。它应该包含System.Web.Http.WebHost.dll。
如果此DLL此文件夹中,检查它的版本。如果不是4.0.0.0,那么你应该部署版本4.0.0.0或更改您的web配置使用其他版本(因为依赖的不是真的好主意)

In Visual Studio 2012 I created an ASP.NET MVC 4 project where the target framework is the .NET Framework 4.5. When I deployed my project to a web server it gave the following 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.

Description: An unhandled exception occurred during the execution of the current web request.
 Please review the stack trace for more information about the error and where
it originated in the code. 

Exception Details: System.IO.FileNotFoundException: 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.

Source Error: 


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34237

解决方案

Check the bin folder of your deployed project. It should contain System.Web.Http.WebHost.dll. If this dll is in this folder, check it version. If it isn't 4.0.0.0, then you should deploy version 4.0.0.0 or change your web config to use other version (not really good idea because of dependencies)

这篇关于无法加载文件或程序集“System.Web.Http.WebHost,版本= 4.0.0.0,文化=中性公钥= 31bf3856ad364e35'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆