2
votes

I am facing the error below during configuration of MSBuild in Jenkins:

[ImageResize] $ cmd.exe /C " msbuild.exe p:Configuration=Release E:\Heena\Applications\ImageResize\vbimage\ImageResize.sln " && exit %%ERRORLEVEL%% 'msbuild.exe' is not recognized as an internal or external command, operable program or batch file. Build step 'Build a Visual Studio project or solution using MSBuild' marked build as failure Finished: FAILURE

Please note that I have set MSBuild path up to msBuild.exe during setting up of MSbuild plugin. I have successfully deployed Visual Studio project on jenkins, but unable to configure it with MSBuild.

2

2 Answers

4
votes
  1. In MSBuild installations option of jenkins,

    Choose the path to MSBuild = C:\Windows\Microsoft.NET\Framework64\v4.0.30319

  2. Then go to your respective jenkins project where you want to build,

    from,Add Build Step menu choose

    Build Visual Studio Project or solution using MSBuild option

  3. MSBuild version will be what you defined in Step 1 and in MSBuild File

    type the path of your solution file and in Command Line Arguments option

    type /p:Configuration=Release.

Hope you got the answer what you were looking for.

0
votes

A Guess from my side , msbuild.exe is not part of the PATH when you execute the msbuild command , check that before you run the command , try to export the the path to msbuild to the path variable.

Looking at the error i assume you are using windows/Batch , so try some thing like this before running msbuild

set PATH=%PATH%;path/to/msbuild/binary

Feel free to revert in case of any issues/concerns