Closed shatodj closed 2 years ago
I am seeing the same. Setting it to use dotnetframework / mono seems to be a workaround.
From my side set runtime: 'full' saved my day
So we found 2 ways of fixing that issue:
UseDotNet@2
as the first step in a job like this
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '2.1.x'
GitVersion
task with 2 separated tasks gitversion/setup@0
and gitversion/execute@0
- task: gitversion/setup@0
inputs:
versionSpec: '5.x'
- task: gitversion/execute@0
Same here, currently adding the:
- task: UseDotNet@2
inputs:
packageType: 'sdk'
version: '2.1.x'
workaround, but a migration to newer dotnet versions would be preferable
@shatodj https://marketplace.visualstudio.com/items?itemName=gittools.gitversion was deprecated in favor of https://marketplace.visualstudio.com/items?itemName=gittools.gittools. Please you the GitTools
bundle that contains GitVersion and not GitVersion
@arturcic Moving to GitTools
didn't fix the problem. I still get this dependency on 2.1.0
, and even installing dotnet SDK 2.1.300
does not help.
@mc0re can you post here the portion of the yaml that installs and then runs the GitVersion from the GitTools
bundle
I have created this template for the purpose:
parameters:
- name: gitversion_config_path
displayName: Path to "GitVersion.yml" from the .sln file
type: string
default: 'GitVersion.yml'
- name: gitversion_version
displayName: Version of the tool to use
type: string
default: '5.x'
- name: gitversion_dotnet
displayName: GitVersion requires 2.x and 3.x .NET SDKs installed for its execution
type: object
# Needs Microsoft.NETCore.App version exactly 2.1.0, which is in SDK 2.1.300
default: ['2.1.300', '3.1.419']
steps:
- task: gitversion/setup@0
displayName: 'Setup GitVersion ${{ parameters.gitversion_version }}'
inputs:
versionSpec: ${{ parameters.gitversion_version }}
- ${{ each version in parameters.gitversion_dotnet }}:
- task: DotNetCoreInstaller@0
displayName: 'Install .NET Core SDK ${{ version }} for GitVersion'
inputs:
version: ${{ version }}
- task: gitversion/execute@0
displayName: Run GitVersion
inputs:
useConfigFile: true
configFilePath: ${{ parameters.gitversion_config_path }}
updateAssemblyInfo: true
This is the error I am getting. Note, it's an on-premise Azure DevOps installation, and most agents work, but some don't.
It was not possible to find any compatible framework version
The framework 'Microsoft.NETCore.App', version '2.1.0' was not found.
- The following frameworks were found:
3.1.25 at [[redacted]\_work\_tool\dncs\3.1.419\x64\shared\Microsoft.NETCore.App]
3.1.26 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
6.0.6 at [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
You can resolve the problem by installing the specified framework and/or SDK.
The specified framework can be found at:
- https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=2.1.0&arch=x64&rid=win10-x64
##[error]SyntaxError: Unexpected end of JSON input
I was able to work around this:
GitVersion is also set up to use dotnet fullframework.
2.1.0 only show up for Runtime from what I can see:
curl https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/2.1/releases.json -s | jq '.releases[]| .runtime.version'
Thankfully, only the Runtime seems to be needed :D
Describe the bug Our pipelines using this task are failing with this message
Our pipeline is defining the task as following:
Expected Behavior
The newer version of .net core should be used.
Actual Behavior
The old version 2.1.0 is used instead.
Possible Fix
Steps to Reproduce
Context
Your Environment
Azure DevOps pipeline task: GitVersion@5.