How to Configure Jenkins to build .NET projects on Linux Machine

Hi there,

I am trying to add Capability to Jenkins to Build .NET 7 Project and getting failed. Right after the $ dotnet build command is being executed receives the below error.

I am using .NET: Build project (build) to build the project in the Linux environment.

$ dotnet build
.NET Command Completed - Exit Code: -1

FATAL: Command execution failed.
java.io.IOException: error=2, No such file or directory
at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
at java.base/java.lang.ProcessImpl.(ProcessImpl.java:340)
at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:271)
at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)

I can confirm that the directory exists in the right path and the project name doesn’t contains any whitespaces. Any ideas?

Thanks, in advance.

It looks like to me that it can’t find the dotnet executable. Is dotnet installed for the user that Jenkins is running as?

1 Like