我尝试使用Visual Studio 2019中的“ASP.NET Core Web应用程序”创建一个简单(默认)的Web API,运行在dotnet core 3.1之上。
一旦我创建了该(默认)应用程序,并通过在Visual Studio中按F5来运行它,我就可以在IIS Express上运行它。
然后,我想要发布它,所以我去了Windows功能,并打开了IIS,然后通过安装“WebPlatformInstaller_x64_en-US.msi”和“dotnet-hosting-3.1.2-win.exe”(针对dot net core)进行了配置。
接下来,我在命令提示符中运行了以下命令:
我使用了DotNet Core 3.1创建了一个Self Contain Package,然后使用“Default Web Site/Test”配置将其发布到指向主机http://localhost。同时创建了一个应用程序池,并选择“No Managed Code”选项。 当我访问http://localhost/Test时,出现了以下错误: 这是我的Web.Config文件:
一旦我创建了该(默认)应用程序,并通过在Visual Studio中按F5来运行它,我就可以在IIS Express上运行它。
然后,我想要发布它,所以我去了Windows功能,并打开了IIS,然后通过安装“WebPlatformInstaller_x64_en-US.msi”和“dotnet-hosting-3.1.2-win.exe”(针对dot net core)进行了配置。
接下来,我在命令提示符中运行了以下命令:
net stop was /y
net start w3svc
我使用了DotNet Core 3.1创建了一个Self Contain Package,然后使用“Default Web Site/Test”配置将其发布到指向主机http://localhost。同时创建了一个应用程序池,并选择“No Managed Code”选项。 当我访问http://localhost/Test时,出现了以下错误: 这是我的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="dotnet" arguments=".\TestApp.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>
<!--ProjectGuid: 63addee1-2c1f-4679-94f4-df9dc952d8f9-->
我不确定这是否是相关信息,当我在IIS中进行透传身份验证测试时,出现以下情况:
我尝试了许多不同的发布方式,但最终都会出现上述错误信息。我们该如何解决这个问题?