简体   繁体   English

无法在Windows 8 IIS上加载文件或程序集'System.Web'或其依赖项之一

[英]Could not load file or assembly 'System.Web' or one of its dependencies on Windows 8 IIS

I got this problem when deploying on my localhost IIS. 在本地IIS上进行部署时遇到此问题。 I haven't experience error when building the system and publish correctly. 构建系统并正确发布时,我没有遇到错误。 But when you browse it on localhost suddenly got error. 但是,当您在localhost上浏览时,突然出现错误。 I already do some research and suggestion on google but nothing works for me. 我已经在Google上进行了一些研究和建议,但对我没有任何帮助。 Can someone help me on this: 有人可以帮我吗:

 Could not load file or assembly 'System.Web' 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' or one of its dependencies. The system cannot find the file specified.

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' could not be loaded. 程序集加载跟踪:以下信息有助于确定为什么无法加载程序集“ System.Web”。

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: 堆栈跟踪:

[FileNotFoundException: Could not load file or assembly 'System.Web' or one of its dependencies. The system cannot find the file specified.]
   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +210
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +242
   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +17
   System.Reflection.Assembly.Load(String assemblyString) +35
   AjaxControlToolkit.ToolkitScriptManagerHelper.GetAssembly(String name) +88
   AjaxControlToolkit.ToolkitScriptManagerCombiner.IsScriptCombinable(ScriptEntry scriptEntry, Boolean enableCdn) +48
   AjaxControlToolkit.ToolkitScriptManager.OnResolveScriptReference(ScriptReferenceEventArgs e) +266
   System.Web.UI.ScriptManager.RegisterScripts() +349
   System.Web.UI.ScriptManager.OnPagePreRenderComplete(Object sender, EventArgs e) +281
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4628

I think you need to register .net Freamework 4.0 for IIS for the above issue. 我认为您需要为上述问题为IIS注册.net Freamework 4.0。 Here are the steps.. 这是步骤。

  • Open Command prompt as Administrator 以管理员身份打开命令提示符
  • Navigate to "C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319" directory in command prompt [use the command cd C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319] 导航到命令提示符下的“ C:\\ Windows \\ Microsoft.NET \\ Framework \\ v4.0.30319”目录[使用命令cd C:\\ Windows \\ Microsoft.NET \\ Framework \\ v4.0.30319]
  • Register .net FrameWork for IIS [use command aspnet_regiis.exe -i] 为IIS注册.net FrameWork [使用命令aspnet_regiis.exe -i]
  • Restart IIS [use command iisreset]. 重新启动IIS [使用命令iisreset]。
  • Done. 做完了

OR THIS 或这个

In VS2010, right click the project in the Solution Explorer and select 'Add Deployable Dependencies'. 在VS2010中,在解决方案资源管理器中右键单击该项目,然后选择“添加可部署依赖项”。 Then check the MVC related check boxes in the following dialog. 然后在以下对话框中选中与MVC相关的复选框。

This creates a '_bin_deployableAssemblies' folder in the project which contains all the .dll files mentioned in other answers. 这将在项目中创建一个'_bin_deployableAssemblies'文件夹,其中包含其他答案中提到的所有.dll文件。 I believe these get copied to the bin folder when creating a deployment package. 我相信这些在创建部署程序包时会复制到bin文件夹中。

or try this: http://haacked.com/archive/2008/11/03/bin-deploy-aspnetmvc.aspx/ 或尝试以下方法: http : //haacked.com/archive/2008/11/03/bin-deploy-aspnetmvc.aspx/

  1. ask your self have you register asp.net with IIS using A SP.NET IIS Registration Tool 问问自己,是否使用SP.NET IIS注册工具在IIS中注册了asp.net?
  2. ask your self have you set the app-pool to be of updated asp.net version . 问问自己,您是否将应用程序池设置为更新的asp.net版本
  3. set identity for app pool . 设置应用程序池的标识。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法加载文件或程序集“System.Web,Version = 4.0.0.0,Culture = neutral”或其依赖项之一。 访问被拒绝 - Could not load file or assembly 'System.Web, Version=4.0.0.0, Culture=neutral' or one of its dependencies. Access is denied 无法加载文件或程序集“System.Spatial”或其依赖项之一 - Could not load file or assembly 'System.Spatial' or one of its dependencies 无法加载文件或程序集“System.Dynamic”或其依赖项之一 - Could not load file or assembly 'System.Dynamic' or one of its dependencies 无法加载文件或程序集“System.Web.Mvc,Version = 3.0.0.0”或其依赖项之一 - Could not load file or assembly 'System.Web.Mvc, Version=3.0.0.0' or one of its dependencies System.IO.FileNotFoundException:无法加载文件或程序集“Windows”或其依赖项之一 - System.IO.FileNotFoundException: Could not load file or assembly 'Windows' or one of its dependencies Mono上的MVC 5:无法加载文件或程序集'System.Web.Entity'或其依赖项之一 - MVC 5 on Mono: Could not load file or assembly 'System.Web.Entity' or one of its dependencies 无法加载文件或程序集“ System.Web.Http”或其依赖项之一 - Could not load file or assembly 'System.Web.Http' or one of its dependencies 找不到包含文档的“无法加载文件或程序集'System.Web.Mvc'或其依赖项之一” - Can't resolve “Could not load file or assembly 'System.Web.Mvc' or one of its dependencies” with documentation found '无法加载文件或程序集 'System.Web.Helpers' 或其依赖项之一 - 'Could not load file or assembly 'System.Web.Helpers' or one of its dependencies Azure 构建管道:错误 ASPPARSE:无法加载文件或程序集“System.web.mobile”或其依赖项之一 - Azure build pipeline: Error ASPPARSE: Could not load file or assembly 'System.web.mobile' or one of its dependencies
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM