I created an episerver alloy project, which builds and runs fine in visual studio after setting up some nuget packages, and I can deploy to azure and run in azure from VS without issue.
I am now trying to get the build to work in pipelines.
Following the instructions, I added a "nuget restore" task, and pointed it at a NuGet.config. This works.
Then it gets to the build stage, and gives:
D:\a\1\s\DxcAlloy.csproj(335,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\3.1.202\Microsoft\VisualStudio\v16.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files\dotnet\sdk\3.1.202\Microsoft\VisualStudio\v16.0\WebApplications\Microsoft.WebApplication.targets" is correct, and that the file exists on disk.
I have no idea how to debug this. Some posts say that error can happen if you dont have visual studio installed, but I cant install visual studio on azure pipelines...
I removed the existing ".net restore" task, as it failed, and am guessing that just my nuget restore is all I need - this is a guess.
The pipeline "agent specification" is vs2017-win16
The project was created in VS 2019.
In desperation, I added a "Use .NET core" task, and set the version to the one which build is complaining is missing, i.e. 3.1.202.
This didn't help.
Any ideas?