簡體   English   中英

無法加載文件或程序集“ System.Web.Http.WebHost…”或其依賴項之一。 該模塊應包含程序集清單

[英]Could not load file or assembly 'System.Web.Http.WebHost…' or one of its dependencies. The module was expected to contain an assembly manifest

我有一個我的客戶在本地部署的MVC應用程序。 它已經工作了多年。

我有一個客戶試圖在此環境中加載它:

  • 服務器 :Windows Small Business Server 2011標准版
  • IIS :7.5
  • .NET :3.5.1&4.5

他們正在作為子域進行部署,但收到此錯誤:

Server Error in '/' Application.

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 
module was expected to contain an assembly manifest.

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.BadImageFormatException: 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 module was expected to contain an assembly manifest.

Source Error: 

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

Assembly Load Trace: The following information can be helpful to determine why the assembly 
'System.Web.Http.WebHost, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 
could not be loaded.


WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value    
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Stack Trace: 


[BadImageFormatException: 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 module was expected to contain an assembly manifest.]
site.MvcApplication.Application_Start() in f:\Users\{path}\site\Global.asax.cs:912

[HttpException (0x80004005): 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 module was expected to contain an assembly manifest.]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext 
context, HttpApplication app) +12864673
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, 
   HttpContext context, MethodInfo[] handlers) +175
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, 
   IntPtr appContext, HttpContext context) +304
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, 
   HttpContext context) +404
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475

[HttpException (0x80004005): 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 module was expected to contain an assembly manifest.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12881540
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, 
   HttpContext context) +12722601

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

我努力了

  • 將指示的dll從工作目錄復制到無濟於事。
  • 檢查應用程序池信息
  • 比較工作站點和該站點之間的設置
  • 許多Google搜索
  • 全新安裝應用程序和IIS

我們嘗試的一切似乎都沒有效果。 有想法嗎?

我刪除了bin文件夾,並重建了應用程序。 然后,我仔細檢查並確定所需的dll在發布時已復制到本地,並且現在可以正常工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM