joacar
joacar

Reputation: 961

Deploying ASP.NET Core ap to Azure: dotnet restore fails

Trying to deploy a asp.net mvc core app to Azure WebApp but it fails when trying to do dotnet restore with the following error

error MSB4057: The target "_GenerateRestoreGraphProjectEntry" does not exist in the project.

In Azure console

dotnet --version
1.0.0-preview3-004056

and on my machine

dotnet --version
1.0.0-preview4-004233

Perhaps I need to set the global.json to target a specific framework if that differs from what I have on my machine.

(this is not part of the question, just spitting my guts out :) This day hasn't been a good day being a .net developer (either on Mac or Windows) since none of them work at the moment after VS 17 RC2 update on .csproj, various msbuild issues and lastly IIS Express authentication stopped working (redirect loop during sign in)

Upvotes: 3

Views: 616

Answers (1)

watashiSHUN
watashiSHUN

Reputation: 10524

Unfortunately changing global.json won't work in your case :(

Azure currently only have these dotnet cli versions

1.0.0-preview1-002702
1.0.0-preview2.1-003155
1.0.0-preview2-003121
1.0.0-preview2-003131
1.0.0-preview2-003156
1.0.0-preview2-1-003177
1.0.0-preview3-004056

based on what you described, it looks like you were able to do dotnet restore locally on your dev machine, but not in Azure

I suspect that this is becuase 1.0.0-preview3-004056 does not have the latest msbuild:

D:\Program Files (x86)\dotnet\sdk\1.0.0-preview3-004056>dotnet.exe MSBuild.dll
Microsoft (R) Build Engine version 15.1.0.0

I don't have your "1.0.0-preview4-004233", but compare to latest dotnet release on github:

C:\Downloads\dotnet-dev-win-x64.latest>dotnet.exe sdk\1.0.0-preview5-004269\MSBuild.dll
Microsoft (R) Build Engine version 15.1.458.808

its not hard to see that Azure is missing couple bug fixes of msbuild (15.1.458.808 > 15.1.0.0)

I would suggest that you change your global.json to version 1.0.0-preview3-004056, and try to dotnet restore your project locally, if it does fail with the same error message, then it would confirm my theory...and the solution is either wait until Azure to catch up or upload your own dotnet cli to Azure

[Edit]

Azure now has 1.0.0-preview4-004233

Upvotes: 2

Related Questions