I am creating a build pipeline for a .Net Framework 4.6 app (Yes I know it needs upgrading but that's the next step).
The tasks I am using to build, test and publish use DotNetCoreCLI
tasks.
When running the build pipeline, this appears to fire the following command
"C:\Program Files\dotnet\dotnet.exe" publish D:\A\B5\_work\386\s\MyProject.csproj --configuration Release --output D:\A\B5\_work\386\a)\MyProject
This produces the following error
error MSB4019: The imported project "C:\Program Files\dotnet\sdk\5.0.214\Microsoft\VisualStudio\v16.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the expression in the Import declaration "C:\Program Files\dotnet\sdk\5.0.214\Microsoft\VisualStudio\v16.0\WebApplications\Microsoft.WebApplication.targets" is correct, and that the file exists on disk.
If I run the dotnet command on the server in the command line I get the same message.
If I run the visual studio instance installed on the build server (MSVS 2019 version 16.9.0) the solution builds with no problems.
Even though visual studio is installed on the server, there is no directory C:\Program Files\dotnet\sdk\5.0.214\Microsoft\VisualStudio
on the server, only C:\Program Files\dotnet\sdk\5.0.214\Microsoft
.
Does this mean something needs to be installed as a prerequisite?
Thanks