I am trying to create a web deployment package for asp.net core web application. When I tried to publish the output as a package using VS2017, I got all the necessary files in "Publish" folder as well a zip file containing all those files in given location.
However I want to have the same using command line. I am able to get "Publish" folder, but not a zip file. What am I doing wrong? Can someone correct my command?
dotnet publish /p:target=package /p:WebPublishMethod=Package /p:LastUsedBuildConfiguration=Release /p:LastUsedPlatform="Any CPU" /p:LaunchSiteAfterPublish=True /p:ExcludeApp_Data=False /p:PublishFramework=netcoreapp1.0 /p:UsePowerShell=True /p:DesktopBuildPackageLocation=C:\Kannan\Temp\package.zip /p:PackageLocation="C:\kannan\temp\package.zip" /p:PackageFileName=C:\kannan\temp\package.zip /p:PackageAsSingleFile=true
It`s depends on the version of your cli.
If you are using the 2.0 version of cli, then you can use dotnet publish command on a windows machine and it would work.
But if you are using 1.0.4 version of the cli, then you should use the msbuild version of the command (The ability to call dotnet build was added in 2.0 cli).
For the detail info, you can refer to the same issue on GitHub.