web.config中的Asp.Net Core标记导致失败 [英] Asp.Net Core tag in web.config causes failure
问题描述
我有一个.NET Core应用程序,它可以在一台机器上运行,而不能在另一台机器上运行.
I have a .NET Core application which works on one machine but not on another.
问题是应用程序无法加载,因为IIS无法识别以下内容
The problem is that the application fails to load, because the IIS does not recognize the following
<aspNetCore processPath="dotnet" arguments=".\MyApp.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
结果是,当我单击IIS身份验证配置时,出现错误.如果删除aspNetCore
标记,则可以查看身份验证设置,但实际上该应用程序无法启动.
The result is that when I click on the IIS authentication configuration, I get an error. If I remove the aspNetCore
tag I can view the authentication settings, but then the application doesn't actually start.
在开始就不对.NET Core使用web.config
提出建议之前,请记住它可以在我的另一台计算机上使用.另外,我需要使用Windows安全性和ASP.NET模拟.
Before you start giving advice about not using web.config
for .NET Core, remember that it works on my other machine. Also, I need to use Windows Security and ASP.NET Impersonation.
两台机器都运行Windows 10 Pro,我已经检查了以下内容
Both machines are running Windows 10 Pro, and I have checked the following
- 已安装IIS功能:完全相同
- WAS和W3SVC:都在本地系统下启动并运行
- 应用程序池:都具有.Net 4.0 CLR,经典模式
- 文件夹和文件的安全性:相同
- 应用程序和所有dll的二进制比较:相同
我通常不使用IIS和.NET,因此我很困惑我的应用程序在两个看似相同的安装之一中中断.我的东西用完了要检查.任何帮助或指示,将不胜感激.
I don't normally work with IIS and .NET, so I'm quite puzzled that my application breaks on one of two seemingly identical installations. I have run out of things to check. Any help or pointers would be greatly appreciated.
这是完整的web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<authentication mode="Windows" />
<authorization>
<deny users="?" />
</authorization>
<identity impersonate="true" />
</system.web>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\MyApp.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
</system.webServer>
</configuration>
<!--ProjectGuid: a447f5e7-6aee-4d26-bef4-c7111a88c409-->
推荐答案
我也遇到了同样的问题,这是因为机器
缺少NET Core Windows Server Hosting捆绑包.如果未安装,则IIS无法识别web.config
I was also facing the same issue and it was because the machine
was missing the NET Core Windows Server Hosting bundle. If this is not installed then IIS cannot recognize the aspNetCore
section in web.config
您可以从下面的位置安装捆绑软件.
You can install the bundle from below location.