无法在IIS7上加载托管ASP.NET Core 2.2的aspnetcorev2.dll

问题描述 投票:6回答:2

我正在努力将ASP.NET Core 2.2站点部署到Windows 7 SP1 IIS7.5。

服务器安装了dotnet-hosting-2.2.1-win。以下是程序和功能条目:Installed Hosting Packages

已注册的IIS模块: enter image description here

应用程序池按以下方式配置:enter image description here

应用程序池仅由一个Web应用程序使用,并在Windows帐户下运行。

我正在使用以下发布设置部署ASP.NET Core 2.2网站:enter image description here

这是部署的web.config文件:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <location path="." inheritInChildApplications="false">
    <system.webServer>
      <handlers>
        <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
      </handlers>
      <aspNetCore processPath=".\App.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
    </system.webServer>
  </location>
</configuration>

无论我做什么,应用程序池都将停止,并在事件查看器中显示以下错误:The Module DLL C:\Program Files\IIS\Asp.Net Core Module\V2\aspnetcorev2.dll failed to load. The data is the error.

我尝试部署:

  • 任何CPU / x86 / x64
  • 赢得-64 / WIN-86 /便携式
  • 自包含/框架依赖
  • hostingModel = “进程内”/ hostingModel = “OutOfProcess”
  • 启用32位应用程序=“true”

还尝试了以下变通方法:https://github.com/aspnet/AspNetCore/issues/6118 https://github.com/aspnet/AspNetCore/issues/4206

无论我做什么,我都无法运行应用程序池。有谁知道可能导致这些问题的原因是什么?

更新由于某些原因,即使.NET Framework上的其他IIS站点以前工作过,现在也无法启动相同的错误 - The Module DLL C:\Program Files\IIS\Asp.Net Core Module\V2\aspnetcorev2.dll failed to load. The data is the error.

答案经过大量挖掘后发现托管软件包的安装程序无法下载Microsoft Visual C ++ 2015 Redistributable。这就是所有网站停止工作的原因。我手动安装它并重新绑定托管包,一切正常。

asp.net-core iis-7.5 windows-7-x64 webdeploy
2个回答
7
投票

经过大量挖掘后发现托管软件包的安装程序无法下载Microsoft Visual C ++ 2015 Redistributable。这就是所有网站停止工作的原因。我手动安装它并重新绑定托管包,一切正常。


2
投票

我在Windows Server 2012 R2上遇到了同样的问题。我尝试重新安装Microsoft Visual C ++ 2015 Redistributable,但错误仍然存​​在。是什么解决了我的问题:

  1. 卸载Runtime&Hosting Bundle和Microsoft Visual C ++ 2015 Redistributable
  2. 运行以下命令检查并修复文件系统: sfc / scannow
  3. 运行以下命令以检查Windows映像是否存在任何损坏并自动执行修复: dism / online / cleanup-image / restorehealth
  4. 运行Windows Update并安装所有更新(这可能需要一段时间)
  5. https://dotnet.microsoft.com/download/dotnet-core/2.2安装Runtime&Hosting Bundle
© www.soinside.com 2019 - 2024. All rights reserved.