.net 使用脚本构建应用程序

build.bat

git fetch
git merge origin/release

%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe 项目目录/项目名称.csproj /t:ReBuild /t:ResolveReferences;Compile /p:Configuration=Release /p:VisualStudioVersion=14.0 /flp1:LogFile=Build.log /p:DeployOnBuild=true /p:publishprofile=../release.pubxml

pause

release.pubxml

<?xml version="1.0" encoding="utf-8"?>
<!--
您 Web 项目的发布/打包进程将使用此文件。您可以通过编辑此 MSBuild 文件
来自定义该进程的行为。若要了解与此相关的详细信息,请访问 http://go.microsoft.com/fwlink/?LinkID=208121。
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>FileSystem</WebPublishMethod>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish />
    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <publishUrl>..\publish</publishUrl>
    <DeleteExistingFiles>True</DeleteExistingFiles>
  </PropertyGroup>
</Project>


.net | 2018-05-20 04:10:25