シンプルにMSbuildコマンドを使う(Visual Studio2019 Community)

MSBuildを使ってビルドしたのでメモる。

■ MSBuildのパスは以下の通り。
↓をWindowsの環境変数に登録する。
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin

Release Build

msbuild /p:Configuration=Release /t:Rebuild 

 

Publish Build

SET MSBuildPath=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\

SET BuildPath=F:\work\DotNetFramework\WebMVC

 

"%MSBuildPath%\MSBuild.exe" "%BuildPath%\WebMVC.csproj" /t:Build /p:DeployOnBuild=true /p:Configuration=Release /p:TargetFramework=v4.7.2 /p:PublishProfile=FolderProfile /p:RestorePackages=false /p:SkipPostSharp=true

 

Publish Buildの出力先

\WebMVC\Properties\PublishProfiles\FolderProfile.pubxml

を確認すると、

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <PropertyGroup>

    <DeleteExistingFiles>False</DeleteExistingFiles>

    <ExcludeApp_Data>False</ExcludeApp_Data>

    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>

    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>

    <LastUsedPlatform>Any CPU</LastUsedPlatform>

    <PublishProvider>FileSystem</PublishProvider>

    <PublishUrl>F:\work\DotNetFramework\publish</PublishUrl>

    <WebPublishMethod>FileSystem</WebPublishMethod>

  </PropertyGroup>

</Project>

 

 

まだまだできることを調査しよう。


(参考)


コメント

このブログの人気の投稿

ソリューション構成ごとにconfigファイルを作成する

C++の古いプロジェクトのビルドでerror MIDL2311 : statements outside library block are illegal in mktyplib compatability mode

web.config debug/releaseの内容を変換構文を使って切り替える