kudu: Git Deployment of ASP.NET Core fails with 'error MSB1009: Project file does not exist'
We have been deploying through Continuous Integration to Azure App Services for quite a bit, today, our builds are broken due to a change on the dotnet CLI.
Right now we see on Kudu that the current CLI version is 1.0.0-preview3-004056. If the App is an ASPNETCore app (xproj / project.json) it’s failing to find the project.
The App Service activity log shows:
Manually running dotnet build
on Kudu console shows:
Repro repo available: https://github.com/ealsur/mvpstream
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 40 (23 by maintainers)
Can you try adding this global.json at the root of your project?
If you don’t have it, then it uses whatever is the latest Core sdk on the box, which changes over time (we now have the new Preview3, which is incompatible).
Linking to forum thread and this StackOverflow question with the same issue.
Also, pasting the actual error as text for SEO purpose:
@dannythomas13 kudu runs build command at repository root (@davidebbo maybe we should put this sentence in the document) your problem would be solved if
dotnet cli
knows which version to launch depending on theglobal.json
in your project/solution directory and NOT THE CURRENT (repository root). This issue is already being tracked on github, and until then we probably don’t want to hack it ourselves in kudu.@leedjones , I took a quick look at your kudu, your
global.json
should be put underD:\home\site\repository
the same place where you put.git
I don’t understand what changed, but I know how you can fix it. Instead of setting PROJECT, try setting SCM_SCRIPT_GENERATOR_ARGS:
I replaced the name of your project by FOO here to not reveal it, so do change that.
Still trying to understand root issue, but prioritizing getting you unblocked for now.