错误2: 'msbuild.exe' 不是内部或外部命令,也不是可运行的程序或批处理文件。 Build step 'Build a Visual Studio project or solution using MSBuild' marked build as failure
解决:一般是你没有把msbuild路径加到环境变量里,如果加了还报这个问题,重启机器测试;如果你是在jenkins里面配置的路径还出这个问题,是不是配错了,这不属于知识性错误,不阐述。
错误3: 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.
解决:错误已经很明确的,既然没有装vs,就把开发机器上的C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\整个目录都拷到CI服务器上,几百M,如果还嫌这个太大,那么你只需要拷贝其中的v10.0或v11.0(看你装的vs版本)这个文件夹即可。
错误4: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(983,5): warning MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend. [C:\Program Files (x86)\Jenkins\jobs\test\workspace\net_zkx_zkkaweb\Zkx.Jkka.Application\Zkx.Jkka.Application.csproj] 解决:你没装vs的话,windows sdk也就是缺失的,其实错误信息已经把解决方案告诉你了:
install the SDK
Targeting Pack for this framework version
retarget your application to a version of the framework for which you have the SDK