.net framework msbuild环境搭建 (不装vs)

1. 安装 .net framework sdk

 小于等于 .net framework 4.5 版本的 .net framework sdk 通过 windows sdk 工具安装

 从下面额链接找到对应的windows SDK下载:

 http://msdn.microsoft.com/en-us/library/windows/desktop/ff851942.aspx

 Win8.1 对应 .NET Framework V4.5.1

 Win8   对应 V4.5

 

2.安装msbuild

 安装包下载地址 https://visualstudio.microsoft.com/zh-hans/thank-you-downloading-visual-studio/?sku=BuildTools&rel=16

 安装步骤

 

 

 

 

3.部署到远程服务器

不用 PublishProfile

"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\msbuild.exe" ./WebApi.csproj /p:Configuration=Release /p:DeployOnBuild=true /p:DeployTarget=MsDeployPublish /p:MsDeployServiceUrl=192.168.xxx.xxx /p:AllowUntrustedCertificate=True /p:MSDeployPublishMethod=WMSvc /p:UserName="xxxxx" /p:Password="xxxxx" /p:DeployIISAppPath="xxxxx" /p:VisualStudioVersion=16.0

用 PublishProfile

"C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\msbuild.exe" ./WebApi.csproj /p:Configuration=Release /p:CreatePackageOnPublish=True /p:DeployOnBuild=true /p:PublishProfile=./Properties/PublishProfiles/FolderProfile.pubxml  /p:VisualStudioVersion=16.0 /p:Password="xxxxx"

 

VisualStudioVersion 对应具体的 vs

 

参考文章 : https://stackoverflow.com/questions/44061932/ms-build-2017-microsoft-webapplication-targets-is-missing

 

posted @ 2019-10-24 16:45  小小高  阅读(5045)  评论(0编辑  收藏  举报