本人使用的是framework4.5 visual studio 2015开发的项目
build命令如下
cd /d D:\work\Test
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe Test.sln /t:Rebuild /p:Configuration=Release;DeployOnBuild=true;VisualStudioVersion=14.0
cd /d D:\work\Test\Test
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe Test.csproj /t:Rebuild /p:Configuration=Release;PublishProfile=Release;DeployOnBuild=true;VisualStudioVersion=14.0
第一个Test名称为解决方案名称 ,第二个为项目名称
Configuration=Release 使用Release环境编译
DeployOnBuild=true 表示部署加编译
VisualStudioVersion =14.0 表示VS2015的版本号
PublishProfile=Release 表示发布名称为Release的
简单build脚本的写法如下:
@echo off
set Configuration=Release
set BuildTargets=ReBuild
set PublishProfile=Release
set DeployOnBuild=true
set VisualStudioVersion=14.0
@echo on
%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe ..\Test.sln /fl1 /flp1:LogFile=Build.log;Verbosity=Normal
pause