将 dotnet core cli mvc 应用程序部署到 azure webservice

deploy dotnet core cli mvc application to azure webservice

我想在 azure WebService 中部署我的 .NET Core MVC 应用程序。我已经使用

在本地构建了该应用程序
dotnet publish

并在我的 wwwroot 目录中使用 Kudu 服务移动了输出代码,但 wabapp 只给我错误页面:

deploy .NET Core CLI MVC application to azure web service

我做错了什么?

我尝试了一个示例项目:

D:\dotnetDummy>dotnet publish
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

  dotnetDummy -> D:\dotnetDummy\bin\Debug\netcoreapp2.0\dotnetDummy.dll
  dotnetDummy -> D:\dotnetDummy\bin\Debug\netcoreapp2.0\publish\  <-- output directory

在本地发布后,您想将输出目录下的所有文件移动到 Azure webapp 的 wwwroot 文件夹,在这种情况下,您在 Kudu 站点上的 D:\home\site\wwwroot 应该看起来与 D:\dotnetDummy\bin\Debug\netcoreapp2.0\publish

D:\dotnetDummy\bin\Debug\netcoreapp2.0\publish>dir /B  
dotnetDummy.deps.json
dotnetDummy.dll
dotnetDummy.pdb
dotnetDummy.PrecompiledViews.dll
dotnetDummy.PrecompiledViews.pdb
dotnetDummy.runtimeconfig.json
web.config   <-- output of dotnet publish

如果你没有在 wwwroot 下看到 web.config,我猜是移动过程中出错了