5

I do not know whether SO is the best place for this problem, so if you know a better location, let me know, than I will move it there.

We had a properly running Azure Devops deployment pool running with an agent on our VPS. But my PAT expired so I installed a new agent (yes I know, I could have just extended the expire date of my PAT, but I failed to realize that at the time).

But when I install the agent through the script that DevOps provides I get the following error message:

System.IO.FileNotFoundException: Could not load file or assembly 'DotNetAgent, Version=1.0.0.0, Culture=neutral, PublicKeyToken=87b69d96e75fbfca'. The system cannot find the file specified. File name: 'DotNetAgent, Version=1.0.0.0, Culture=neutral, PublicKeyToken=87b69d96e75fbfca'

I have already tried:

  1. to update the MSBuild tool on the VPS.
  2. remove all agents from VPS
  3. remove all my PATs from DevOps and generate a new one while copying the script in DevOps

Edit 1 added system information

Windows Server 2012 R2 64-bit

Powershell engine version 4 0 -1 -1 (used this)

This version detection tool detects I have these versions of asp.net framework installed

  • .NET FW 2.0 SP 2 (CLR:2.0)

  • .NET FW 3.0 SP 2 (CLR:2.0)

  • .NET FW 3.5 SP 1 (CLR:2.0)

  • .NET FW 4.6.2 General release (CLR:4.0)

  • .NET FW 4.7 General release (CLR:4.0)

  • .NET FW 4.7.1 General release (CLR:4.0)

  • .NET FW 4.7.2 General release (CLR:4.0)

  • .NET FW 4.8 General release (CLR:4.0)


Edit 2 added bounty for whichever answer is correct or leads me to the correct solution

Daniël Tulp
  • 1,745
  • 2
  • 22
  • 51

2 Answers2

0

It is said in Microsoft site that Starting December 2019, the minimum required .NET version for build agents is 4.6.2 or higher.

You can check if .NET Framework 4.6.2 or higher is installed on your machine.

See below prerequisites to install on-premise agent:

  • Windows 7, 8.1, or 10 (if using a client OS)
  • Windows 2008 R2 SP1 or higher (if using a server OS)
  • PowerShell 3.0 or higher
  • .NET Framework 4.6.2 or higher

Check the document here for more information.

The PAT token is only used during the installation of the agent. You donot need to install a new agent when the PAT is expired. See below note from microsoft document here.

Note: when using PAT as the authentication method, the PAT token is only used during the initial configuration of the agent. Later, if the PAT expires or needs to be renewed, no further changes are required by the agent.

Update:

You can check out this link and try downloading a different version(eg. an older version) of the deployment agent package.

After the deployment agent package is downloaded, create a new folder (eg. c:/mydeployagent), unzip the package to this folder, then run below command from the powershell;

.\config.cmd --deploymentgroup --deploymentgroupname "your deployment group name" --agent $env:COMPUTERNAME --runasservice --work '_work' --url 'https://dev.azure.com/yourOrganization/' --projectname 'Your project Name'

Levi Lu-MSFT
  • 27,483
  • 2
  • 31
  • 43
  • Hi @DaniëlTulp you can visit [this site](https://github.com/microsoft/azure-pipelines-agent/releases), and have a try installing a different version of the deployment agent. Please check out above update for details. – Levi Lu-MSFT May 25 '20 at 10:06
  • I tried installing as far back as 2.163.1 but none worked, how far back should I go? – Daniël Tulp May 26 '20 at 19:44
0

In the end we were not able to fix it, also not with the help of Microsoft devs. They did offer to look into it in more detail, but only at a very costly fee and without guarantees for success.

So we ended up setting up a new VPS and migrating all our applications to the new VPS and now everything is working again. This was cheaper in terms of spent hours by us and the IT support agency we use, compared to what Microsoft wanted as payment for just looking into it.

Daniël Tulp
  • 1,745
  • 2
  • 22
  • 51