xcopy /s /y “$(SolutionDir)packages\Apache.Ignite.1.6.0\Libs\*.*” “$(TargetDir)Libs” error while building in jenkins

落爺英雄遲暮 提交于 2020-01-06 06:09:37

问题


Hello All, while building Visual project project from jenkins am getting below error i have set msbuild plugin and set path in jenkins.

C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: The command " [C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\DrawingsFabricApi.csproj] C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: if not exist "C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\bin\x64\Debug\Libs" md "C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\bin\x64\Debug\Libs" [C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\DrawingsFabricApi.csproj] C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4714,5): error MSB3073: xcopy /s /y "Undefinedpackages\Apache.Ignite.2.2.0\Libs*.*" "C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\bin\x64\Debug\Libs"" exited with code 4. [C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\DrawingsFabricApi.csproj] Done Building Project "C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\DrawingsFabricApi.csproj" (default targets) -- FAILED.

Build FAILED.

"C:\Users\Administrator.jenkins\workspace\DrawingsFabric\DrawingsFabricApi\DrawingsFabricApi.csproj" (default target) (1) -> (ResolveAssemblyReferences target) ->


回答1:


According to the error log:

error MSB3073: xcopy /s /y "Undefinedpackages\Apache.Ignite.2.2.0\Libs*.*"

You can find $(SolutionDir) is Undefined.

That because you may build the a single project (NOT Solution) in jenkins. In this case, MSBuild running each project independently not the Solution, so MSBuild could not find the define for $(SolutionDir). It worked fine in Visual Studio, but not on the build server.

To resolve this issue, you can use $(ProjectDir)..\ instead of $(SolutionDir)

So the command line should be:

if not exist "$(TargetDir)Libs" md "$(TargetDir)Libs" 
xcopy /s /y "$(ProjectDir)..\packages\Apache.Ignite.2.2.0\Libs\*.*" "$(TargetDir)Libs"

But, I found the command line in the error log is not same as in the title, so you may need to double check the command line.

Hope this helps.



来源:https://stackoverflow.com/questions/46722779/xcopy-s-y-solutiondirpackages-apache-ignite-1-6-0-libs-targetdirl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!