Asp.net-Mvc-3

配置錯誤:System.Web.Helpers

  • October 8, 2018

我將站點部署到伺服器,但出現此錯誤。為什麼我會得到這個?

Configuration Error 
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: Could not load file or assembly 'System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

Source Error: 


Line 16:       <assemblies>
Line 17:         <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 18:         <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 19:         <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 20:         <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />

Source File: C:\<path>\web.config Line: 18 

Assembly Load Trace: The following information can be helpful to determine why the assembly 'System.Web.Helpers, Version=1.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].

看起來您部署應用程序的伺服器沒有安裝 ASP.NET MVC 3。如果您不想在伺服器上安裝 ASP.NET MVC 3,您也可以bin 部署您的應用程序。

我遇到了同樣的問題,我從 Microsoft 站點安裝了 ASP.NET MVC 3 Tools Update,它解決了這個問題。

還要在安裝之前檢查 C:\Program Files (x86)\Microsoft ASP.NET 是否存在。就我而言,這個文件夾失去並且安裝後我有這個文件夾並且程序集已註冊。

引用自:https://stackoverflow.com/questions/12528238