JetBrains / teamcity-dotnet-plugin

TeamCity plugin for .NET projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unmet requirement DotNetCLI_Path exists

chris1248 opened this issue · comments

I have a linux build agent running on RedHat Enterprise Linux 8.
The agent is up and running and I have .NET core installed on it:

[me@teamcity-linux-agent-rhel8-1 conf]$ dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.1.108
Commit: c423b556b5
Runtime Environment:
OS Name: rhel
OS Version: 8
OS Platform: Linux
RID: rhel.8-x64
Base Path: /usr/lib64/dotnet/sdk/3.1.108/
Host (useful for support):
Version: 3.1.8
Commit: 9c1330dedd
.NET Core SDKs installed:
3.1.108 [/usr/lib64/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.8 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.8 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download

But when I want to specify a build step using the .NET tool (i.e. dotnet build), I get this error:

Unmet requirements:
DotNetCLI_Path exists

I have tried setting the DOTNET_HOME environment variable in the buildAgent.properties file to the following different combinations:

env.DOTNET_HOME=/usr/lib64/dotnet/sdk/3.1.108/
env.DOTNET_HOME=/usr/lib64/dotnet/sdk/
env.DOTNET_HOME=/usr/lib64/dotnet/

Nothing works. I still get that unmet requirement.
I've searched online, but only see help requests pointing to windows installations, not linux.

What do we set DOTNET_HOME to?

@chris1248 could you share a TeamCity version?

Version:

2020.1.1 (build 78657)

@chris1248 Unfortunately, I cannot reproduce. Could you please share a "teamcity-agent.log"?

I was dealing with the same issue with Oracle Linux 7 and had installed dotnet through Microsoft's dotnet-install.sh. Regardless of what I set the DOTNET_HOME or PATH variables to TeamCity wouldn't detect the DotNetCLI_Path. While looking through Teamcity documentation I found the .NET Version Detection Algorithm documents that it also looks at the directory of /usr/share/dotnet. After using the dotnet-install.sh script to install it there the problem went away. I hope this helps anyone else who encounters this issue.

@joshua5822 , although my DOTNET_HOME was set correctly (/usr/share/dotnet) that documentation showing the detection algorithm was kinda helpful but why they haven't done it for MSBuild?
https://www.jetbrains.com/help/teamcity/msbuild.html
Mine just can't find the MSBuild path at all
Unmet requirements:
MSBuildTools16.0_x64_Path exists

Tried setting env variable in bashrc, buildagent.properties, within the build configuration parameters, I've tried moving the MSBuild folder into /usr/share/dotnet but it just can't find it.
Setup:
ubuntu 20.04 docker container.
TeamCity Enterprise 2020.2 (build 85487).
Microsoft (R) Build Engine version 16.11.1+3e40a09f8 for .NET.
Also have Microsoft (R) Build Engine version 16.6.0 for Mono