msbuild找不到在jenkins上构建的目标(.csproj)

时间:2017-06-14 09:09:05

标签: jenkins build msbuild

我正在尝试在Jenkins中构建这样的解决方案:

Build a Visual studio project or solution using MSBuild

msbuild version: msbuild5.0 x86
msbuild build file: myproyect.sln
command line arguments:/p:DeployOnBuild=true 
/p:PublishProfile=C:\PUBLISHING_PROFILES\FIRECOM_LOCAL.pubxml 
/p:FrameworkPathOverride="C:\Windows\Microsoft.NET\Framework\v4.0.30319" 
/p:VisualStudioVersion=14.0
/target:MODELS\EntityModel;Common;NotificationLib;AccessLib;
       RemappLib;MODELS\FireWeatherModel;MODELS\EResponseWeatherModel;
       EResponseLib;FISLib;MODELS\LightningModel;MODELS\ResourceTrackingModel;
       ERESPONSEClient_myclient

所有目标编译除了最后一个(ERESPONSEClient_myclient),Jenkins找不到它(但它在工作区中)

这是错误:

C:\Jenkins\jobs\ERESPONSE_CORE\workspace\MODELS\ResourceTrackingModel\ResourceTrackingModel.csproj
: error MSB4057: The target "ERESPONSEClient_myclient" does not exists in the project.

提前感谢你的宝贵帮助。

1 个答案:

答案 0 :(得分:0)

这是我的解决方案:

第1步:

Build a Visual studio project or solution using MSBuild

msbuild version: msbuild5.0 x86
msbuild build file: myproyect.sln
command line arguments:
/p:DeployOnBuild=true 
/p:PublishProfile=C:\PUBLISHING_PROFILES\FIRECOM_LOCAL.pubxml 
/p:FrameworkPathOverride="C:\Windows\Microsoft.NET\Framework\v4.0.30319" 
/p:VisualStudioVersion=14.0
/target:MODELS\EntityModel;Common;NotificationLib;AccessLib;
       RemappLib;MODELS\FireWeatherModel;MODELS\EResponseWeatherModel;
       EResponseLib;FISLib;MODELS\LightningModel;MODELS\ResourceTrackingModel;

第2步:

Build a Visual studio project or solution using MSBuild

msbuild version: msbuild5.0 x86
msbuild build file:  ERESPONSEClient_myclient.csproj
command line arguments:
/p:DeployOnBuild=true 
/p:PublishProfile=C:\PUBLISHING_PROFILES\FIRECOM_LOCAL.pubxml 
/p:FrameworkPathOverride="C:\Windows\Microsoft.NET\Framework\v4.0.30319" 
/p:VisualStudioVersion=14.0

在此之后,我在Nuget包中遇到了另一个错误,我不得不删除.csproj中的最后一个目标