azure - .net core azure部署失败: Project file does not exist

标签 azure asp.net-core .net-core azure-web-app-service

我在 Azure 中设置了一个应用程序服务应用程序,该应用程序设置为在提交到团队服务 git 存储库时部署。到目前为止,这一直工作正常,但部署失败,并显示:

MSBUILD : error MSB1009: Project file does not exist.

但是,如果我打开 Azure 控制台和 CD 到我的项目目录,我可以看到项目文件(asp.net core .xproj)确实存在。我从部署日志的输出中知道它位于正确的目录中,表明正在恢复包:

Command: "D:\home\site\deployments\tools\deploy.cmd"
Handling ASP.NET Core Web Application deployment.
Restoring packages for D:\home\site\repository\IDPTest\src\IDPTest\project.json...
Restoring packages for tool 'Microsoft.AspNetCore.Server.IISIntegration.Tools' in D:\home\site\repository\IDPTest\src\IDPTest\project.json...
Committing restore...
Lock file has not changed. Skipping lock file write. Path: D:\home\site\repository\IDPTest\src\IDPTest\project.lock.json
D:\home\site\repository\IDPTest\src\IDPTest\project.json
Restore completed in 10549ms.
Restoring packages for D:\home\site\repository\IDPTest\src\IDPTest.MVCClient\project.json...
Restoring packages for tool 'BundlerMinifier.Core' in D:\home\site\repository\IDPTest\src\IDPTest.MVCClient\project.json...
Restoring packages for tool 'Microsoft.AspNetCore.Razor.Tools' in D:\home\site\repository\IDPTest\src\IDPTest.MVCClient\project.json...
Restoring packages for tool 'Microsoft.AspNetCore.Server.IISIntegration.Tools' in D:\home\site\repository\IDPTest\src\IDPTest.MVCClient\project.json...
Committing restore...
Lock file has not changed. Skipping lock file write. Path: D:\home\site\repository\IDPTest\src\IDPTest.MVCClient\project.lock.json
D:\home\site\repository\IDPTest\src\IDPTest.MVCClient\project.json
Restore completed in 7119ms.

NuGet Config files used:
    C:\DWASFiles\Sites\#1IDPTest\AppData\NuGet\NuGet.Config

Feeds used:
    https://api.nuget.org/v3/index.json
Microsoft (R) Build Engine version 15.1.0.0
Copyright (C) Microsoft Corporation. All rights reserved.

MSBUILD : error MSB1009: Project file does not exist.
Switch: D:\home\site\repository\IDPTest\src\IDPTest.MVCClient
Failed exitCode=1, command=dotnet publish "D:\home\site\repository\IDPTest\src\IDPTest.MVCClient" --output "D:\local\Temp\8d40eb8007743fd" --configuration Release
An error has occurred during web site deployment.
\r\nD:\Program Files (x86)\SiteExtensions\Kudu\59.51109.2534\bin\Scripts\starter.cmd "D:\home\site\deployments\tools\deploy.cmd

"

有趣的是,我有两个应用程序服务应用程序指向同一解决方案中的不同项目。突然间,尽管他们正在部署不同的项目,但他们都失败并出现相同的错误消息......

非常感谢任何帮助。

谢谢

编辑

我的解决方案根目录中已经有一个 global.json (与我的 .sln 文件处于同一级别),但它指向旧版本的 SDK,因此我更新了它,但没有什么区别。然后我尝试删除 json 文件中的“测试”项目,但这也没有什么区别。仍然失败并出现相同的错误 enter image description here

最佳答案

显然,您需要在 global.json 中明确指定 SDK 版本,否则 Kudu 使用的是最新版本,现在是不兼容的 Preview3。

{
"projects": [ "src", "test" ],
"sdk": {
    "version": "1.0.0-preview2-1-003177"
    }
}

请小心,您的 global.json 文件应位于存储库的根目录下。

详细信息:https://social.msdn.microsoft.com/Forums/en-US/2a301f82-6a7a-4c03-ad4a-bd8714d72ba6/continious-deployment-of-aspnet-core-app-suddenly-starts-to-fail-today?forum=windowsazurewebsitespreview&prof=required

关于azure - .net core azure部署失败: Project file does not exist,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40650681/

相关文章:

c# - 在 ASP.NET Core 中访问 _Layout.cshtml 中的 cookie

c# - 将 Serilog 与 Caliburn Micro .Net Core 3.1 结合使用

java - 在 Azure Java Functions 中,无法读取测试/生产环境中的 host.json 值

azure - 如何在 Azure 门户中监视 Azure 数据同步过程

asp.net-core - 我的自定义 ASP.Net 5 MVC 6 标签助手应该有一个 asp- 前缀吗?

c# - 直接从数据库返回 IEnumerable 或之前使用 ToListAsync

c# - 替换 .NET 6/.NET Core 中过时的 Assembly.CodeBase

c# - 在 ASP.NET Core 中初始化依赖注入(inject)时传递参数

java - Application Insights Log4j 按日志文件名筛选

azure - 如何使用二头肌模板将自定义域添加到azure函数应用程序