Today I was busy setting up a new CI pipeline on Azure DevOps. As part of this pipeline I wanted to create a web deploy package that later can be picked up by a release pipeline to deploy it on multiple environments.
Here is the pipeline I created:
Unfortunately when I tried to run this pipeline, it failed with the following error message:
/usr/share/dotnet/sdk/6.0.401/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeployPackage.targets(97,5): error MSB6004: The specified task executable location "%ProgramW6432%/IIS/Microsoft Web Deploy V3/msdeploy.exe" is invalid. [/home/vsts/work/1/s/Example/Example.csproj]
##[error]Error: The process '/usr/bin/dotnet' failed with exit code 1
The reason why this fails is because MSDeploy
is a Windows-only thing. Inside my pipeline I had specified to use a Linux build server. That explains why it cannot find "%ProgramW6432%/IIS/Microsoft Web Deploy V3/msdeploy.exe".
To fix it, I updated my pipeline to use a Windows VM instead: