2016-11-17 57 views
15

我有一個在Azure中設置的應用服務應用,該應用設置爲在提交到團隊服務git存儲庫時部署。這一直工作正常直到如今,部署與失敗:.net核心Azure部署失敗:項目文件不存在

MSBUILD : error MSB1009: Project file does not exist. 

不過,如果我打開蔚藍的控制檯和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 

有趣的是我有同樣的在不同的項目指向兩個表觀服務應用解決方案。Suddently他們都具有相同的錯誤消息失敗,即使他們正在部署不同的項目...

任何幫助非常讚賞。

感謝

編輯

我已經在我的解決方案根global.json(在同一水平作爲我的.sln文件),但指着一個老版本的SDK,所以我更新了這一點,它沒有區別。然後我試着擺脫json文件中的'test'項目,這也沒有任何區別。仍然出現同樣的錯誤enter image description here

+0

你提交支援地方公共?我剛剛也體驗過這一點。 – ThomasArdal

+0

@ThomasArdal不,不知道他們需要提交的地方。好的方式不僅僅是我。試圖在幾分鐘前重新部署。同樣的問題 – LDJ

+0

也許在這裏:https://portal.azure.com/#create/Microsoft.Support – ThomasArdal

回答

20

顯然你需要在你的global.json中明確地指定SDK版本,否則Kudu會使用最新的,它現在是預覽版3不兼容的版本。

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

+0

這對我沒有幫助。我的存儲庫根目錄中已經有一個global.json文件,所以我將其更新到最新的SDK版本,但是我仍然得到相同的部署錯誤 – LDJ

+0

@LDJ如果您有一個repro,其中global.json不起作用,請採取通過https://github.com/projectkudu/kudu/issues/2230查看,並根據需要添加。 –

+1

@LDJ我今天有同樣的問題,它似乎只是一個在Azure上的錯誤,在這裏報告:https://github.com/dotnet/cli/issues/4804嘗試做dotnet構建沒有路徑,但在在運行命令之前正確的目錄。 – jsgoupil

相關問題