I am trying to build a web deploy package on the .net core sdk docker image to be used to deploy to a windows server running iis (the deployment being done on a seperate windows vm). This is the command I am running (this can also be done via the publish UI in visual studio):
dotnet publish src/SpaceForce.sln -c release -o out -p:WebPublishMethod=Package;PackageAsSingleFile=True;DesktopBuildPackageLocation="../Package/SpaceForce.WebAPI.zip"
On Windows this produces a folder with the following files and then when i'm ready to deploy, i just run the cmd file:
SpaceForce.WebAPI.deploy.cmd
SpaceForce.WebAPI.deploy-readme.txt
SpaceForce.WebAPI.Parameters.xml
SpaceForce.WebAPI.SetParameters.xml
SpaceForce.WebAPI.SourceManifest.xml
SpaceForce.WebAPI.zip
but on Linux (.net core sdk docker image) it produces the following error:
/usr/share/dotnet/sdk/3.1.300/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/osboxes/src/spaceforce/src/SpaceForce.WebAPI/SpaceForce.WebAPI.csproj]
on this page, it has this note but i'm not sure if this applies in my case:
The
dotnet msbuildcommand is a cross-platform command and can compile ASP.NET Core apps on macOS and Linux. However, MSBuild on macOS and Linux isn't capable of deploying an app to Azure or other MSDeploy endpoints.
If i can build on linux, i am happy to run the cmd file on a windows box for deployment. Is it possible to build this package on linux?
mcr.microsoft.com/dotnet/sdk:3.1-focaland with the command:dotnet publish src/MyApp.sln -c release -f netcoreapp3.1 -o release -v n. I use a windows server to deploy