web 项目添加 x86 的dll 引用,模块 DLL c:WINDOWSsystem32inetsrvaspnetcore.dll 未能加载。

摘要:
最新的项目需要添加一个x86编译的dll。首先,添加引用、编译并报告错误。首先,判断无法将x86引用添加到项目中,因此所有项目都以x86方式编译。同时,相应的IIS应用程序池也被修改为启用32位。该错误在本地开发环境中报告,但在部署到服务器进行测试时可以正常显示。也有人说,该错误是由Windows 10的年度更新引起的。现在我们终于明白了为什么服务器部署可以正常工作。

最近的项目要添加一个 x86 编译的dll,

首先添加引用,编译,报错:

web 项目添加 x86 的dll 引用,模块 DLL c:WINDOWSsystem32inetsrvaspnetcore.dll 未能加载。第1张

首先判断是 项目中不能添加 x86 的引用,所以把所有的项目都按照 x86 的方式编译一遍,同时对应IIS 的应用池,也修改为启用32位。

web 项目添加 x86 的dll 引用,模块 DLL c:WINDOWSsystem32inetsrvaspnetcore.dll 未能加载。第2张

web 项目添加 x86 的dll 引用,模块 DLL c:WINDOWSsystem32inetsrvaspnetcore.dll 未能加载。第3张

 本以为可以顺利显示,但是却报错。报错的是本机开发环境,但是部署到服务器测试却能够正常显示。

web 项目添加 x86 的dll 引用,模块 DLL c:WINDOWSsystem32inetsrvaspnetcore.dll 未能加载。第4张

根据网上的提示,查看 系统日志里的应用程序日志,

web 项目添加 x86 的dll 引用,模块 DLL c:WINDOWSsystem32inetsrvaspnetcore.dll 未能加载。第5张

 再根据此错误信息,网上搜索,终于找到了解决方法。

1. 如果报错是 rewrite.dll , 则在程序-应用和管理 中修复 对应的IIS URL Rewrite Module 2。

2. 如果报错是 aspnetcore.dll ,则在程序-应用和管理中修复 Microsoft .NET Core 1.0.0 - VS 2015 Tooling ...

在搜到该解决方案之前, 我已经把所有的.netcore 的程序卸载了,再重新按章 .Net Core SDK 依然无效,最后根据方案中的方法,搜索到了 

DotNetCore.1.0.1-VS2015Tools.Preview2.0.3.exe, 重新安装修复。

看来是必需要修复一次。而且说是 windows10 的anniversary更新引起的错误,至此终于明白为啥服务器部署可以正常了。

Installing the recently released Anniversary Update (version 1607) of Windows 10 seems to destabilize IIS by shutting down Application Pools, thus resulting in a 503 error when trying to run an application, which is caused by some DLLs failing to load when the worker process starts. Fortunately, the lovely folks of the interwebz are coming to the rescue!

First, check out the Windows Event Viewer (Win+X, V) to see what you need to fix: Open "Windows Logs", then "Application" and look for "Error" level entries with the source "IIS-W3SVC-WP" (may be different if the name of your IIS instance is not the default one). In the details, you will see a short message, like this:

The Module DLL <path-to-DLL> failed to load.  The data is the error.

Depending on your configuration, there may be different DLLs causing this kind of problem and they will occur one by one, so you will need to keep checking the Event Logs and fix the issues until your application properly starts up. To be sure, before every attempt, stop IIS and close IIS Manager.

Here are two specific issues we've experienced so far and how to fix them, but you may bump into completely different ones:

  1. "C:WINDOWSsystem32inetsrv ewrite.dll" (reference)
    • Go to "Programs and Features" (Win+X, F) and repair "IIS URL Rewrite Module 2".
  2. "C:WINDOWSsystem32inetsrvaspnetcore.dll" (reference)
    • Go to "Programs and Features" (Win+X, F) and repair "Microsoft .NET Core 1.0.0 - VS 2015 Tooling ...".

Happy updating!

Hi paramesh,

I don't know from the top of my head, but you can try (re)installing them from PS using Web Platform Installer. Or if you have installed those from Web Platform Installer in the first place, then you probably still have the .msi installers on your machine (for example on my machine they are under "C:UsersBenedekAppDataLocalMicrosoftWeb Platform Installerinstallers") - in that case you can repair them from PS using "msiexec" with the "fa" switch (which runs a forced repair).

This command works on my machine for URL Rewrite 2, for you the path might be different:
msiexec /fa "C:UsersBenedekAppDataLocalMicrosoftWeb Platform InstallerinstallersUrlRewrite26A98B994ADCC2E8D21507BF2B8BAFFB402C17395 ewrite_amd64.msi"

For "Microsoft .NET Core 1.0.0 - VS 2015 Tooling", the installer (at least on my machine) is in one of the subfolders of "C:ProgramDataPackage Cache", so for example the latest version I have installed (differs from what's in the blogpost) is "C:ProgramDataPackage Cache{da280276-4f5b-4918-8d40-20ca56dfa535}DotNetCore.1.0.1-VS2015Tools.Preview2.0.3.exe". "msiexec" won't be able to handle this, since it's an exe, but you might be able to just run it from PS, although I'm not sure if that'll work without GUI.

Please let me know if it helped and if they work, then I'll add them to the blogpost.

 https://orcharddojo.net/blog/troubleshooting-iis-apppool-crashes-status-503-after-windows-10-anniversary-update

 

免责声明:文章转载自《web 项目添加 x86 的dll 引用,模块 DLL c:WINDOWSsystem32inetsrvaspnetcore.dll 未能加载。》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇ubuntu 默认防火墙安装、启用、查看状态express 如何定义生产和开发环境下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

IIS日志-网站运维的好帮手

感谢原博主!原博客地址:http://www.cnblogs.com/fish-li/p/3139366.html 对于一个需要长期维护的网站来说,如何让网站长久稳定运行是件很有意义的事情。 有些在开发阶段没有暴露的问题很有可能就在运维阶段出现了,这也是很正常的。 还有些时候,我们希望不断地优化网站,让网站更快速的响应用户请求, 这些事情都发生在开发之...

win7 安装SQL Server 2005 开发版 图文教程

转自win7 安装SQL Server 2005 开发版 图文教程   ----------------------------写在安装前------------------------------ 一、SQL server 版本介绍  (1) SQL Server 2005 Express Edition(快速开发版) 微软的免费,但比企业版的...

首次启动速度慢的问题记录IIS性能优化

ASP.NET网站发布的时候需要预编译.这样不但能解决首次速度慢的问题,还能把cshtml的内容编译.这样别人就看不到我们VIEW的代码了.那么打开VS. 发布的时候把"在发布期间预编译"打钩,点击后面的设置取消选择"允许更新预编译站点".这样编译出来的网站view被编译成.compiled文件.并且根目录下多了一个PrecompiledApp.conf...

IIS 常见异常及解决办法

Ø  简介 IIS 是我们平常接触比较多的服务端软件,用于站点发布等,本文主要记录 IIS 常见的异常及解决办法。主要包括: 1.   Visual Studio 启动 Web 项目提示“无法启动 IIS Express Web 服务器” 2.   清除VS 的 IIS运行缓存 3.   编译器错误消息: CS0016 4.   503 Error Cod...

iis7 下配置MVC问题

HTTP 错误 404.0 - Not Found 您要找的资源已被删除、已更名或暂时不可用。 详细错误信息 模块 IIS Web Core 通知 MapRequestHandler 处理程序 StaticFile 错误代码 0x80070002 最可能的原因: 指定的目录或文件在 Web 服务器上不存在。 URL 拼写错误...

转:IIS 应用程序池 内存 自动回收

原文地址:https://www.cnblogs.com/guohu/p/5209209.html IIS可以设置定时自动回收,默认回收是1740分钟,也就是29小时。IIS自动回收相当于服务器IIS重启,应用程序池内存清空,所有数据被清除,相当于IIS重启,在度量快速开发平台服务器端,为了减小数据库负担,内存中暂存了很多信息,不适合频繁的回收,因为回收会...