Azure 应用服务不 运行 Asp.Net 来自 VSTS 的核心应用

Azure App Service doesn't run Asp.Net Core app from VSTS

使用 VSTS(VS2017 构建任务)发布 asp.net 核心应用时,应用无法启动,构建和发布工作正常。

症状:

解决方案: 事实证明,使用 Visual Studio 2017 发布会向部署添加一个带有处理程序映射的 Web.Config 文件,其中添加了以下内容aspNetCore.

的默认处理程序映射

最奇怪的是 Web.Config 文件在调试控制台中不可见,即使您从 Kudu 工具下载 wwwroot 文件夹也是如此。即使很清楚需要处理程序映射,工具中还是有些奇怪。

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath=".\Web.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
  </system.webServer>
</configuration>
<!--ProjectGuid: 50547f5d-25a5-4720-9216-92d42583b679-->