16

I recenlty updated my TeamCity to the newest Version. (10.0 build 42002)

Since then the build agent can't build any of my projects.

The agent tells me the following:

Unmet requirements: DotNetFramework4.0_x86 exists 

To solve this problem I already did what was suggested in this stackoverflow question: TeamCity Agent Missing DotNetFramework4.0_x86, but not?

Sadly it doesn't work. So I looked at the log files but didn't find anything weird. Then I looked at the agent configuration paramets. I found this:

DotNetFramework4.6.01055_x64_Path    C:\Windows\Microsoft.NET\Framework64\v4.0.30319
DotNetFramework4.6.01055_x86_Path    C:\Windows\Microsoft.NET\Framework\v4.0.30319
DotNetFramework4.6_x64               4.6.01055
DotNetFramework4.6_x64_Path          C:\Windows\Microsoft.NET\Framework64\v4.0.30319
DotNetFramework4.6_x86               4.6.01055
DotNetFramework4.6_x86_Path          C:\Windows\Microsoft.NET\Framework\v4.0.30319

As you can see the .NET 4.0 Framework is mapped to DotNetFramework4.6. For me this seems to be the problem.

Has someone an idea what I can do to fix this?

Community
  • 1
  • 1
Shamshiel
  • 2,051
  • 3
  • 31
  • 50
  • Just in case this helps anyone, I just ran into this and was able to resolve it by simply restarting the teamcity build agent windows service . – Sam Rueby Sep 08 '21 at 20:04

3 Answers3

24

I used the work around from Greg B found here to solve the problem.

To get the agent back running you need to insert following lines to the config of the agent. (For example located here: C:\TeamCity\buildAgent\conf\buildAgent.properties)

DotNetFramework4.0_x86_Path=C\:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319
DotNetFramework4.0_x86=4.0.30319
DotNetFramework4.0_x64_Path=C\:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319
DotNetFramework4.0_x64=4.0.30319
  1. I stopped the agent in the windows services
  2. I pasted the parameters in the buildAgent.properties
  3. I started the agent in the windows services

As far as I understand JetBrains fixed a bug in TeamCity and because of this the .NET Frameworks will not be found anymore.

Quote from Evgeniy Koshkin

...in case your tool targeting .net 4.0 as its required runtime you actually should avoid installing .net 4.5(6) on your build agents. in that case TeamCity will report that .net 4.0 runtime is available. But i don't think this limitation of installed .net version makes sence in most of the cases. Before this bug was fixed TeamCity reports the fact '.net 4.0 was previously a runtime on this agent' as '.net 4.0 is a runtime on this agent'. It's a buggy behaviour in my point of view.

Petrus Theron
  • 27,855
  • 36
  • 153
  • 287
Shamshiel
  • 2,051
  • 3
  • 31
  • 50
7

Ok, looks like it was a bug with the xUnit test runner plugin. It's talked about on the TC issue tracker: https://youtrack.jetbrains.com/issue/TW-46352

The plugin author has already fixed it, you need to upgrade to v 1.1.2: https://github.com/carlpett/xUnit-TeamCity/releases/tag/1.1.2

You can upgrade by installing the .zip file according to: https://confluence.jetbrains.com/display/TCD10/Installing+Additional+Plugins

bj0
  • 7,893
  • 5
  • 38
  • 49
  • Thank you for the answer but I don't have the plugin "xUnit" installed. So this can't be the problem, or am I wrong? – Shamshiel Aug 02 '16 at 04:59
  • 1
    Check your build steps and disable them until the agent requirement goes away. That is the step adding the requirement, it might be a different Unit Test runner (or another plugin). – bj0 Aug 02 '16 at 17:09
1

The .NETFramework 4.0 and 4.6 are using the same directory

DotNetFramework4.0_x64   4.0.30319
DotNetFramework4.0_x64_Path  C:\Windows\Microsoft.NET\Framework64\v4.0.30319
DotNetFramework4.0_x86   4.0.30319
DotNetFramework4.0_x86_Path  C:\Windows\Microsoft.NET\Framework\v4.0.30319

DotNetFramework4.6_x64   4.6.01055
DotNetFramework4.6_x64_Path  C:\Windows\Microsoft.NET\Framework64\v4.0.30319
DotNetFramework4.6_x86   4.6.01055
DotNetFramework4.6_x86_Path  C:\Windows\Microsoft.NET\Framework\v4.0.30319

There is two possibles solutions for that:

Didier Aupest
  • 3,227
  • 2
  • 23
  • 35
  • I have .NET Framework 4.0 and .NET Framework 4.6 installed. With "fix the agent requirement " you mean going to the Project Settings/Agent Requirements? I saw this solution in another stackoverflow answer but I can't change the requirements there. There is only an option to add new requirements. – Shamshiel Aug 01 '16 at 11:29
  • I just upgraded to v10 and am getting this problem. I don't have DotNet 4.0 installed but my project builds with 4.5 and built fine on v9.x. It seems like the dotnet4.0 requirement is auto-added by the MSBuild build step (I don't have 4.0 selected) and I cannot figure out how to remove it. – bj0 Aug 01 '16 at 23:47
  • Actually it looks like the requirement is being added by the xUnit test runner, even though I have 4.5 selected. – bj0 Aug 01 '16 at 23:54
  • Ok, it was a bug and it's been fixed, I'll post an answer. – bj0 Aug 02 '16 at 00:05