asp.net-mvc – 不应加载引用程序集以执行
发布时间:2020-09-06 06:33:16 所属栏目:asp.Net 来源:互联网
导读:当我尝试在Visual Studio中调试它时,我的网站突然抛出此错误消息.如果我部署网站,它的工作没有任何错误. 任何解决此错误的建议. [ConfigurationErrorsException: Could not load file or assembly Microsoft.Win32.Primitives or one of its dependencies. Re
当我尝试在Visual Studio中调试它时,我的网站突然抛出此错误消息.如果我部署网站,它的工作没有任何错误. 任何解决此错误的建议. [ConfigurationErrorsException: Could not load file or assembly 'Microsoft.Win32.Primitives' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)] System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName,Boolean starDirective) +738 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +217 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170 System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +92 System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath,Boolean& isRefAssemblyLoaded) +290 System.Web.Compilation.BuildManager.ExecutePreAppStart() +157 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager,IApplicationHost appHost,IConfigMapPathFactory configMapPathFactory,HostingEnvironmentParameters hostingParameters,PolicyLevel policyLevel,Exception appDomainCreationException) +531 [HttpException (0x80004005): Could not load file or assembly 'Microsoft.Win32.Primitives' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9946132 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +90 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr,HttpContext context) +261 解决方法尝试从web.config中删除该部分<dependentAssembly> <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-4.0.10.0" newVersion="4.0.10.0" /> </dependentAssembly> (编辑:哈尔滨站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 在asp.net中使用eval(“”)
- 修改服务器配置 让asp.net文件后缀名随心所欲
- asp.net-mvc – 使用输出缓存和其他动作过滤器
- asp.net-mvc – 从Api控制器内生成绝对的url to action
- asp.net-core – 编译netcoreapp1.0,代码包含#if!NETSTAND
- asp.net-mvc – ASP.NET MVC中的WebApi [FromUri]是什么?
- asp.net-core – 我为什么要选择带有.Net核心的ASP.NET Cor
- asp.net-mvc – ASP.NET Web Api – 将对象发布到自定义动作
- 什么用于ASP.NET的成员资格
- asp.net-mvc – 如何将ASP.Net MVC路径段中的1或0映射到布尔
推荐文章
站长推荐
- asp.net汉字转拼音和获取汉字首字母的代码
- 在IIS / ASP.Net中的.NET 1.1应用程序中创建.NET
- asp.net中XML如何做增删改查操作
- asp.net-mvc – ASP.NET MVC 3 Beta 1 Block访问
- asp.net-mvc – 如何使用ASP.NET MVC ApiControl
- asp.net-mvc – 从页面到局部视图的asp.net mvc参
- asp.net-mvc – MVC Razor获取月份名称
- asp.net – Azure可以运行WPF吗?
- asp.net-mvc – 在MVC Controller中访问GET参数
- ASP.NET虚拟路径映射到另一个不允许的应用程序
热点阅读