Dotnet Core publish to IIS from Mac Dotnet Core publish to IIS from Mac docker docker

Dotnet Core publish to IIS from Mac


From a terminal window navigate to the folder where your .csproj file is. From there run 'dotnet publish -c release'. A folder called publish will be created in bin/Release/netcoreappX.X. You can copy those files to the appropriate directory on your server. If you need help setting up IIS, follow the link below.

https://docs.microsoft.com/en-us/aspnet/core/publishing/iis

You can also run 'dotnet publish -h' to see all of the different arguments you can pass to the publish command.


Web Deploy (msdeploy.exe) seems to work in Mono, at least in WSL (Ubuntu 18.04). The tricky part is to extract the msi package somehow, which you can do easily on a Windows machine (you'll find the files in C:\Program Files\IIS\Microsoft Web Deploy V3).

Once you install Mono and obtain msdeploy.exe, just call the command, e.g.

mono msdeploy.exe -verb:sync -source:contentPath=/mnt/c/Data -dest:contentPath=test,ComputerName=https://example.com:8172/msdeploy.axd,UserName=WDeployAdmin,Password=PASSWORD,IncludeAcls=False,AuthType=Basic -enableRule:AppOffline -enableRule:DoNotDeleteRule -verbose -allowUntrusted:true

This lets you sync/copy the contents of /mnt/c/Data with the test web site in IIS on example.com with Web Deploy enabled.