UnabletoloadfileorassemblySystem.Web.WebPages.Deployment我正在开发一个系统网页,突然出现这个错误:Couldnotload文件或程序集'System.Web.WebPages.Deployment,Version=1.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35'或其依赖项之一。该系统找不到指定的文件。我已经验证了我的xml文件配置,一切都很好。这是堆垛跟踪:[FileNotFoundException:无法加载文件或程序集“System.Web.WebPages.Deployment,Version=1.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35”或其依赖项之一。系统找不到指定的文件。]System.Reflection.RuntimeAssembly._nLoad(AssemblyNamefileName,StringcodeBase,EvidenceassemblySecurity,RuntimeAssemblylocationHint,StackCrawlMark&stackMark,IntPtrpPrivHostBinder,BooleanthrowOnFileNotFound,BooleanforIntrospection,BooleansuppressSecurityChecks)+0System.Reflection。RuntimeAssembly.InternalLoadAssemblyName(AssemblyNameassemblyRef,EvidenceassemblySecurity,RuntimeAssemblyreqAssembly,StackCrawlMark&stackMark,IntPtrpPrivHostBinder,BooleanthrowOnFileNotFound,BooleanforIntrospection,BooleansuppressSecurityChecks)+210System.Reflection.RuntimeAssembly.InternalLoad(StringassemblyString,EvidenceassemblySecurity,StackCrawlMark&stackMark,IntPtrpPrivHostBinder,用于自省的布尔值)+242System.Reflection.RuntimeAssembly.InternalLoad(StringassemblyString,EvidenceassemblySecurity,StackCrawlMark&stackMark,用于自省的布尔值)+17System.Reflection.Assembly.Load(StringassemblyString)+35System.Web.Configuration.CompilationSection.LoadAssemblyHelper(StringassemblyName,BooleanstarDirective)+122[ConfigurationErrorsException:无法加载文件或程序集'System.Web.WebPages.Deployment,Version=1.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35'或其依赖项之一。系统找不到指定的文件。]System.Web.Configuration.CompilationSection.LoadAssemblyHelper(StringassemblyName,BooleanstarDirective)+12480704System.Web.Configuration.AssemblyInfo.get_AssemblyInternal()+202System.Web.Compilation.BuildManager.GetReferencedAssemblies(编译部分compConfig)+331System.Web.Compilation.BuildManager.CallPreStartInitMethods(StringpreStartInitListPa日,布尔&isRefAssemblyLoaded)+148System.Web.Compilation.BuildManager.ExecutePreAppStart()+172System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManagerappManager,IApplicationHostappHost,IConfigMapPathFactoryconfigMapPathFactory,HostingEnvironmentParametershostingParameters,PolicyLevelpolicyLevel,ExceptionappDomain151Exception)+[HttpException(0x80004005):无法加载文件或程序集“System.Web.WebPages.Deployment,Version=1.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35”或其依赖项之一。系统找不到ed.]文件规范System.Web.HttpRuntime.FirstRequestInit(HttpContextcontext)+12601936System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContextcontext)+159System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequestwr,HttpContext24context)请检查下面参考15System.Web.Webpages版本中的步骤1。假设你的版本是=XXXX2.在Webconfiga.首先添加组件b。将程序集绑定到运行时3.确保添加了正确的密钥这对我有用。希望对你也有帮助。我通过在项目的web.config中添加以下行解决了这个问题...在我标记MANAGENUGET“Microsoft.AspNet.Mvc/5.1.2”、“MicrosoftASP.NETWebPages/3.1.2”之前,我尝试了一切但没有任何效果(真的!!卸载VS并阅读了很多文章)祝你好运在我的情况下,由于我的笔记本电脑崩溃重启,它是一个损坏的程序集。要解决此问题,请按照以下步骤清理项目以下文件夹中的所有文件,或者只需单击“清理项目”和“清理解决方案”来清理我的Win7机器上的Appdata临时文件夹,它位于Windows7中的C:Usersyour_usernameAppDataLocalTemp临时ASP.NET文件希望这有帮助!我通常做的是转到编译代码的机器,然后转到DOS提示符并键入C:>dirSystem.Web.WebPages.Depl*/susuallytheremaybeseveralc:/windows/Microsoft.Net/assembly/GAG_MSIL/System.web.WebPage/v....../检查日期,确保与System.Web.WebPages.dll一致,复制到目标机所在的bin中。这应该可以解决问题。将这段代码复制到Web.config的“Configuration”中即可完成此操作以上为C#学习教程:无法加载文件或程序集System.Web.WebPages.Deployment分享的全部内容,如果对大家有用需要的了解更多C#学习教程,希望大家多加关注-本文收集自网络,不代表立场。如涉及侵权,请点击右侧联系管理员删除。如需转载请注明出处:
