.net核心azure部署失败:项目文件不存在

时间:2016-11-17 09:07:50

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

我在Azure中设置了一个app-service应用程序,设置为在提交到team-services git存储库时进行部署。到目前为止,这一直工作正常,并且部署失败了:

MSBUILD : error MSB1009: Project file does not exist.

但是,如果我打开azure控制台和CD到我的项目目录,我可以看到项目文件(一个asp.net核心.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

有趣的是,我有两个app-service应用程序指向同一解决方案中的不同项目。突然之间,即使他们正在部署不同的项目,他们也都失败了同样的错误信息......

任何帮助都非常感激。

由于

修改

我的解决方案根目录中已经有了一个global.json(与我的.sln文件处于同一级别)但是它指向了旧版本的SDK,所以我对此进行了更新,并没有任何区别。然后我尝试摆脱json文件中的'test'项目,这也没有任何区别。仍然失败并出现相同的错误enter image description here

1 个答案:

答案 0 :(得分:20)

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

{
"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