2012-09-21 69 views
12

我部署一個網站的服務器和我得到這個錯誤。我爲什麼得到這個?配置錯誤:System.Web.Helpers

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]. 

回答

26

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

2

我有同樣的問題,我從微軟網站安裝ASP.NET MVC 3種工具更新,它解決了這個問題。

而且檢查C:\ Program Files文件(x86)的\微軟ASP.NET是在安裝之前就存在。在我的情況下,這個文件夾丟失和安裝後,我有這個文件夾和程序集註冊。

0

我有下面的情況。一款全新的Visual Studio 2015筆記本電腦,適用於較舊的MVC3項目。 Visual Studio 2015和更高版本顯然不再安裝MVC 3.因此,在下載AspNetMVC3ToolsUpdateSetup.exe並安裝它後,找到正確的引用(來自GAC)。並且構建完成,沒有任何錯誤,除了此安裝外,不需要額外的步驟。