Working on a dotnet core test pipeline, running on a Windows Self hosted agent, I have errors.
As my project uses DotNet Core 3.1 and when I run "dotnet --version" on the agent it gives 5.0.100, I thought I had to install DotNet Core 3.1 but looking at Add/Remove Programs, I see versions 3.1.301 and 5.0.100
My pipeline contains:
- job: Test
displayName: 'Test'
steps:
task: UseDotNet@2 inputs: packageType: 'sdk' version: '3.1.x'
task: NuGetAuthenticate@0 displayName: 'Authenticate with NuGet'
task: DotNetCoreCLI@2 inputs: command: test projects: 'src/Tests/*.csproj' testRunTitle: 'Tests' arguments: '--collect "Code coverage"' publishTestResults: true
I added "UseDotNet" with the goal of setting the version I want to use but I got this error:
##[error]Failed to download or parse releases-index.json with error: {"code":"UNABLE_TO_GET_ISSUER_CERT_LOCALLY"}
I removed "UseDotNet" and then I had:
Info: .NET Core SDK/runtime 2.2 and 3.0 are now End of Life(EOL) and have been removed from all hosted agents. If you're using these SDK/runtimes on hosted agents, kindly upgrade to newer versions which are not EOL, or else use UseDotNet task to install the required version.
##[warning].NET 5 has some compatibility issues with older Nuget versions(<=5.7), so if you are using an older Nuget version(and not dotnet cli) to restore, then the dotnet cli commands (e.g. dotnet build) which rely on such restored packages might fail. To mitigate such error, you can either: (1) - Use dotnet cli to restore, (2) - Use Nuget version 5.8 to restore, (3) - Use global.json using an older sdk version(<=3) to build
Does it mean I should migrate the entire solution to .Net 5 ? That seems like a large task...
Thanks and regards.