用【Jenkins】搭建.NET自动编译测试与发布环境

本示例在Windows操作系统下搭建,前提条件是已安装.NET Framework.

1. 从 https://jenkins.io/download/下载Jenkins的Windows安装包。

2.安装好后浏览器访问 http://localhost:8080

3.配置编译和测试插件,通过点击 Jenkins -> 系统管理 -> 管理插件 打开如下页面在可选插件选项卡下选中:

 然后点击直接安装。

4. 配置MSBuild的路径,通过点击 Jenkins -> 系统管理 -> 全局工具配置,找到MSBuild 配置节:

输入MSBuild在服务器上的安装路径,如: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\MSBuild.exe 

完成点击Save。

扫描二维码关注公众号,回复: 2317287 查看本文章

如果编译的机器上没有安装Visual Studio, 在编译的过程中可能会引发MSB4019错误:

error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

对于这种情况,可以将开发机上的C:\Program Files (x86)\MSBuild文件夹之间拷贝到编译机上。

 *****************************
 *** Keep learning and growing. ***
 *****************************

猜你喜欢

转载自www.cnblogs.com/gangle/p/9352972.html