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:SomePathpackage" /p:OutDir="C:SomePathout" /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /maxcpucount:1 /p:platform="Any CPU" /p:configuration="Release" /p:DesktopBuildPackageLocation="C:SomePathpackagepackage.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:SomePathpackage" /p:OutDir="C:SomePathout" /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /maxcpucount:1 /p:platform="Any CPU" /p:configuration="Release" /p:DesktopBuildPackageLocation="C:SomePathpackagepackage.zip"
For the detail info, you can refer to the same issue on GitHub.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…