Skip to main content
  1. Posts/

How to fix ".NET Framework 2.0 or later is required on this computer to run a Jenkins agent as a Windows service"

·211 words·1 min· ·
Xianpeng Shen
Author
Xianpeng Shen
DevOps & Build Engineer | Python Enthusiast | Open Source Maintainer
Table of Contents

When I upgrade Jenkins 2.176.3 to Jenkins 2.235.1, my Windows agent can not connect with master successfully and outcome this warning message “.NET Framework 2.0 or later is required on this computer to run a Jenkins agent as a Windows service”.

It means I need to upgrade my Windows agent .NET Framework. Here are steps about how to upgrade .NET Framework to version 3.5.

Install .NET Framework 3.5
#

  1. Open Programs and Features

    Programs and Features

  2. Select .NET Framework 3.5 Features (In my screenshot, it had already installed)

    Features

Then try to reconnect the Jenkins agent, then it should back to work.

Install Jenkins agent service
#

If you can not found a Jenkins agent like me,

Jenkins agent service

You can try these steps to install Jenkins agent

# install Jenkins agent service
cd c:\\jenkins
.\jenkins-agent.exe install
net start jenkinsslave-C__agent

# unstall Jenkins agent service
sc delete jenkinsslave-C__agent

Manual install .NET Framework 3.5
#

Btw, if you could not install .NET Framework 3.5 successfully. you can try to install manually by this step

  1. Manually download microsoft-windows-netfx3-ondemand-package.cab

  2. Specify the path like below to install(note: the path is the directory where the file located)

    microsoft-windows-netfx3-ondemand-package.cab file path

In my case no need to reboot the Windows agent.

Hopefully, this also works for you. Let me know in case you have any comments.

Related

Jenkins Multibranch Pipeline

·405 words·2 mins
Discusses the use of Jenkins Multibranch Pipeline to manage multiple branches in a project, enabling parallel builds for pull requests and efficient code review processes.

Jenkins Top 3 best practice

·906 words·5 mins
Discusses three best practices for Jenkins: Configuration as Code, Shared Libraries, and Multi-Branch Pipeline, highlighting their benefits in terms of transparency, traceability, and self-service builds.