DotNetCLI_Path not found
I am configuring a few new build agents and cannot get TeamCity to recognize the DotNetCLI_Path
of these agents. I have an older agent where this works just fine, but cannot recall any specific steps to set that parameter. On the older agent and the newer, the dotnet cli is in /usr/lib/dotnet/dotnet
. The first agent reports this.
Can someone please help me understand what I need to do to get TeamCity to pick up the path from the agent?
Thanks!
Please sign in to leave a comment.
Hi Luis,
Is
/usr/lib/dotnet/
present in thePATH
orDOTNET_HOME
environmental variables on the second agent? TC agents check standard .NET install locations. However, if you made any changes in the environment (e.g., set one of the variables I mentioned) when the agent was running, the agent needs to be restarted.Can you execute
dotnet --list-sdks
anddotnet --list-runtimes
on the second agent and let me know the output.Also, which TeamCity version do you currently use?
Hello Mikhail. Thanks for the reply.
TC Version: TeamCity Professional 2024.07.3 (build 160765)
Yes,
/usr/lib/dotnet/
is present in PATH on the second agent. While I recall rebooting the second agent, I just rebooted it now and it is the same and DotNetCLI_Path is not showing up as an agent parameter.Here's the output from the second agent:
Hi Luis,
Please upload the
teamcity-agent.log
that covers the agent startup to https://uploads.jetbrains.com/. Let me know the upload ID once done.Mikhail Efremov The upload id is: Upload id: 2025_02_06_uSkLjA1TEqgVaZ84v2TRwd (file: teamcity-agent.log)
Thanks!
Hi Luis,
What OS distribution do you use on the second agent? Judging by the paths, I assume it might be Ubuntu 22.04+. For some reason, Canonical changed the default .NET CLI location in their latest distros, which caused the problem on our side. See https://youtrack.jetbrains.com/issue/TW-90668/Update-Plugin-for-.NET-Runtime-Detection-on-Ubuntu-22.04-24.04.
The agent that is working is
Ubuntu 24.04 LTS
. The agent where the DotNetCLI_Path isn't picked up isUbuntu 24.04.1 LTS
. Looking at the issue you liked to, it seems I can just install dotnet to/usr/share/dotnet
?Doing what I mentioned and rebooting, I now see the DotNetCLI_Path being picked up
Hi Luis,
That's a perfectly viable workaround. It's good to know the issue is resolved.
I also created a knowledge article about this problem. Hopefully, it can help other users facing the same problem: SUPPORT-A-990.