CZEMacLeod / MSBuild.SDK.SystemWeb

This MSBuild SDK is designed to allow for the easy creation and use of SDK (shortform) projects targeting ASP.NET 4.x using System.Web.
MIT License
151 stars 8 forks source link

dotnet publish #20

Closed FalkWinkler closed 2 years ago

FalkWinkler commented 2 years ago

How can use the dotnet publish command?

CZEMacLeod commented 2 years ago

@FalkWinkler This SDK does not support the dotnet command (other than for creating a new project using the template) as it is all NETFramework based. You can use MSBuild to build and publish your project.

msbuild /t:Publish /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingeFile=true /p:PackageLocation="MyPublishDir"

or

msbuild "path\to\your\solution.sln" /t:rebuild ^
                    /p:Configuration=Release ^
                    /p:DeployOnBuild=True ^
                    /p:DeployDefaultTarget=WebPublish ^
                    /p:WebPublishMethod=FileSystem ^
                    /p:DeleteExistingFiles=True ^
                    /p:publishUrl="path\to\your\output\folder"

These properties are documented for MSBuild and Publishing Profiles for ASP.NET 4 WebApplication projects.