dotnet publish command is not creating zip file package for asp.net core web application project

前端 未结 1 1625
一生所求
一生所求 2020-12-11 01:39

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

相关标签:
1条回答
  • 2020-12-11 02:30

    What am I doing wrong? Can someone correct my command?

    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.

    dotnet build WebApplicationDeploy.sln /nologo /p:PublishProfile=Release /p:PackageLocation="C:\Some\Path\package" /p:OutDir="C:\Some\Path\out" /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /maxcpucount:1 /p:platform="Any CPU" /p:configuration="Release" /p:DesktopBuildPackageLocation="C:\Some\Path\package\package.zip"
    

    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).

    msbuild WebApplicationDeploy.sln /nologo /p:PublishProfile=Release /p:PackageLocation="C:\Some\Path\package" /p:OutDir="C:\Some\Path\out" /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /maxcpucount:1 /p:platform="Any CPU" /p:configuration="Release" /p:DesktopBuildPackageLocation="C:\Some\Path\package\package.zip"
    

    For the detail info, you can refer to the same issue on GitHub.

    0 讨论(0)
提交回复
热议问题