Jenkins can't find msbuild

I installed Jenkins on Windows Server 2012, in which everything worked fine. However, as soon as I tried to configure the plugins for the MSBuild and VS Code metrics, I get the following error:

C: \ Windows \ Microsoft.NET \ Framework \ v3.5 \ msbuild.exe is not a Jenkins wizard directory (but maybe it exists on some subordinates)

I checked the paths and they are correct, but Jenkins cannot access them.

Someone may suggest that it may be wrong.

thanks

+7
jenkins msbuild windows-server-2012
source share
7 answers
  C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ MSBuild.exe
 C: \ Program Files (x86) \ MSBuild \ 12.0 \ Bin \ MSBuild.exe
Jenkins was very important to you with his requirements. MSBuild.exe is executable, not a directory, as it reports. In the input field, you must specify the folder containing MSBuild.exe , but the task is executing . MSBuild expects you to provide a file name. The way around this discrepancy between Job and Configuration Manager is to configure the Add the MSBuild plugin without specifying the name of the executable in the Path to MsBuild to satisfy the verification requirements on the Add Plugin page.

After adding the plugin, you can change Path to MsBuild to contain the name of the executable file (which, of course, MSBuild.exe ), and not a validation error, you will receive a warning.

  Ignore the warning. 
 Save it anyway.  

It bypasses the initial test required to add the plug-in and will "just work."

Save it anyway

Your Jenkins service should most likely be granted access to the file system "by allowing it to interact with the desktop," as mentioned by other posters. Jenkins service

But your main problem is that the configuration plug-in conflicts with the agent, which uses the configuration, and to use the plug-in to perform assemblies, you need to use a workaround.

+11
source share

I had the same problem. The solution for me was:

If you use Jenkins as a Window service, you probably need to enable the service to interact with the desktop. Follow these steps:

Open the Services module (click: WindowsKey + R> Services.msc)

  • Right-click on the Jenkins service and select Properties
  • On the "Login" tab, launch the "Local system account" and check "Allow work with the desktop."

- OR -

You can run just run Jenkins through the command line. That is: "java -jar jenkins.war" (the jenkins.war file is located in the Jenkins installation directory).

Greetings

J.

+4
source share

Remove the ".exe" extension from the end of the msbuild.exe file in your path to avoid warnings: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild .

+4
source share

So, you have two servers with Jenkins, one is a master (which does not have msbuild), and the other is a slave (this has msbuild). When your task is executed (on the host computer), the msbuild step fails because it does not exist on the host server.

You need to make your work work only on the server with msbuild, and not with the wizard. Here's how you do it:

  • Open configuration for node that has msbuild on
  • In the Shortcuts field add msbuild
  • Save the node configuration
  • Open job configuration
  • In the Advanced project options section, find Restrict where this project can run , and check it
  • In the Shortcut field add msbuild
  • Save task
  • Task assembly
+3
source share

Well

  • Does C:\Windows\Microsoft.NET\Framework\v3.5\ on the core server?
  • Is a Jenkins user available for this folder?
0
source share

I also see that the error message "... is not a directory on the Jenkins master ...", but when I try to build it, it's all the same.

Do not forget to select the MS Build version for your project instead (by default).

See: build a .net application in Jenkins using MSBuild

0
source share

It looks like this problem was resolved in version 1.26: JENKINS-28679

0
source share

All Articles