Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.net core azure deployment failing: Project file does not exist

I have an app-service app set up in Azure which is set to deploy upon commit into a team-services git repository. This has been working fine until now, and the deployment is failing with:

MSBUILD : error MSB1009: Project file does not exist.

However, If I open the azure console and CD to my project directory I can see that the project file (an asp.net core .xproj) does indeed exist. I know its in the correct directory from the output in the deployment log, showing that the packages are being restored:

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

"

Interestingly I have two app-service apps pointing at different projects in the same solution. Suddently they're both failing with the same error message even though they're deploying different projects...

Any help much appreciated.

Thanks

EDIT

I already had a global.json in my solution root (at the same level as my .sln file) but that was pointing at an older version of the SDK, so I updated this and it made no difference. I then tried getting rid of the 'test' project in the json file and that made no difference either. Still failing with the same errorenter image description here

like image 921
LDJ Avatar asked Nov 17 '16 09:11

LDJ


1 Answers

Apparently you need to specify the SDK version explicitly in your global.json otherwise Kudu is using the latest which is now the preview3 one which is not compatible.

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

Be careful, you global.json file should live at the root of your repository.

Details: 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

like image 187
MatthieuGD Avatar answered Oct 21 '22 13:10

MatthieuGD