Open JoaoNeto-TGRE opened 11 months ago
Almost got the same issue with v6.x (but the runner has both 6.x & 8.x versions)
Tool to install: .NET Core sdk version 6.0.x.
Found version 6.0.417 in channel 6.0 for user specified version spec: 6.0.x
Version: 6.0.417 was found in cache.
Failed while prepending .Net Core Tool path to PATH envrionment variable. Error: {}
Finishing: Install .NET 6.0.x SDK
The worst thing on my side is that the task appears as succeed, whereas obviously nothing will work without the DOTNET_CLI_HOME
env var
Any news on this? I have same error with .NET SDK 8.0.301 and UseDotNet 2.238.1
I get the following error when installing 6.x on Ubuntu 22.04.4 LTS:
Tool to install: .NET Core runtime version 6.x.
Found version 6.0.33 in channel 6.0 for user specified version spec: 6.x
Version: 6.0.33 was found in cache.
Failed while prepending .Net Core Tool path to PATH envrionment variable. Error: The "path" argument must be of type string. Received undefined
Finishing: UseDotNet
Debug task output: task-output.txt
Here is the task definition:
- task: UseDotNet@2
inputs:
packageType: 'runtime'
version: '6.x'
I have had the same issue with .NET 9.x. Here is the solution:
Have the following config in your yaml pipeline:
- task: UseDotNet@2
displayName: 'Install .NET Core SDK'
inputs:
version: 9.x
installationPath: '$(Agent.TempDirectory)/dotnet'
Then in the right top corner of your Azure (web) editor click "Variables" and add:
Name: DOTNET_CLI_HOME
Value: $(Agent.TempDirectory)/dotnet
That's it!
New issue checklist
Task name
UseDotNet
Task version
2.232.0
Issue Description
When installing runtime 8.0.0 using the UseDotNet task I got the following error
Failed while prepending .Net Core Tool path to PATH envrionment variable. Error: {"code":"ERR_INVALID_ARG_TYPE"}
I spotted that this line of usedotnet.ts does not run as I cannot see the message in the logs. Scrolling up a bit I noticed the use of
path.join
that throws the error Invalid Argument when it does not receive a string. From the call here it receives a Constant defined as a path from the utilities file.Going through Git Blame I did not see any recent changes to any of these files so I don't know if this is the cause of the issue.
Environment type (Please select at least one enviroment where you face this issue)
Azure DevOps Server type
dev.azure.com (formerly visualstudio.com)
Azure DevOps Server Version (if applicable)
No response
Operation system
Ubuntu 20.04
Relevant log output
Full task logs with system.debug enabled
Repro steps