jenkins编译asp.net常见问题
jenkins好像用的蛮广泛的,很多家公司都在用,这里就发一些最近在一台新节点上部署Asp.net网站遇到的问题:
首先来说说环境,除了按照jenkins之外,我们还需要按照 .net 2.0 4.0之类的按照你项目来,我这里是4.0,然后建议安装一个MS SDK,很多东西都能装上,如果没装,可能会出现下面的错误:
error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.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.
error MSB3091: Task failed because "AxImp.exe" was not found, or the correct Microsoft Windows SDK is not installed. The task is looking for "AxImp.exe" in the "bin" subdirectory beneath the location specified in the InstallationFolder value of the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A. You may be able to solve the problem by doing one of the following: 1) Install the Microsoft Windows SDK. 2) Install Visual Studio 2010. 3) Manually set the above registry key to the correct location. 4) Pass the correct location into the "ToolPath" parameter of the task. [
环境配置差异导致找不到文件:
(GetAspNetMergePath target) -> C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\Web\Transform\Microsoft.Web.Publishing.AspNetCompileMerge.targets(132,5): error : Can't find the valid AspnetMergePath
解决方法是找到jenkins部署机器上的真实路径,比如我的是:
C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools
只要将这个路径放在Jenkins的编译指令中就可以了,比如我的:
/t:Rebuild /property:Configuration=Release;PublishProfile=jenkins-DB2Eshang;DeployOnBuild=true;VisualStudioVersion=12.0 /property:TargetFrameworkVersion=v4.5 /p:AspnetMergePath="C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools
相关推荐
达观数据 2020-11-11
汪康 2020-10-30
ppppfly 2020-10-24
synshitou 2020-10-21
programmeryu 2020-09-24
Topbeyond 2020-08-21
lrcoop 2020-08-18
young依然 2020-08-17
oden 2020-08-16
lrcoop 2020-08-15
yserver 2020-08-15
王永迪 2020-08-15
pursuemylife 2020-08-14
pandaphinex 2020-08-09
leonranri 2020-07-26
CloasGao 2020-07-21
zccheu 2020-07-18