通过IIS加载错误发布网站

时间:2012-08-22 10:29:53

标签: asp.net-mvc

大家好,当我通过IIS运行我的项目时,我得到了这个错误,你可以在下面看到

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 20:       <assemblies>
Line 21:         <add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 22:         <add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 23:         <add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
Line 24:         <add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />


Source File: C:\Users\furkan\Desktop\WebCity\WebCity\web.config    Line: 22 

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.

1 个答案:

答案 0 :(得分:1)

好的伙伴我找到了解决方案。当您收到此错误时,您必须检查位于bin文件中的丢失的dll文件。

第一种方式是:

Microsoft.Web.Infastructure
System.Web.Helpers
System.Web.Mvc
System.Web.Razor
System.Web.WebPages
System.Web.WebPages.Deployment
System.Web.WebPages.Razor

你可以从C:\ Program Files \ Microsoft ASP.NET \ ASP.NET网页找到这些dll文件,然后你必须将dll文件复制到你的项目bin文件夹。

第二种方式是

在Visual Studio中打开项目,然后单击名称为

的引用
   Microsoft.Web.Infastructure
    System.Web.Helpers
    System.Web.Mvc
    System.Web.Razor
    System.Web.WebPages
    System.Web.WebPages.Deployment
    System.Web.WebPages.Razor

从属性

更改“Copy Local = True”