Skip to content

[enhancement]: improve .NET version selection #22040

@CaringDev

Description

@CaringDev

Task name

UseDotNet@2

Describe your feature request here

In #21860 the .NET version selection changed to always use the latest allowed one. Now, under the following conditions

  • useGlobalJson
  • global.json with rollForward != disable
  • VS (that is, not installing SDKs separately)
  • lock files packages.lock.json
  • solutions containing projects that reference SDK-version dependent (implicit) packages

this poses an issue when a new patch version is released which is not yet published with VS.
E.g. we set our global.json to latest SDK included with VS (10.0.202) and an update (10.0.203) gets released.
Also: we want useGlobalJson to minimize version mismatches / edits when updating.
Also: we use lock-files for improved traceability and security.
Also: we use rollForward: latestPatch to allow devs to update their installations without immediately updating the projects.
Also: we do not want to manage SDKs manually, i.e. we rely on VS Installer

Now the build fails because in the CI pipeline run e.g. Microsoft.NET.ILLink.Tasks gets updated from 10.0.6 to 10.0.7

Proposed solution: change the version resolution logic s.t. if rollFoward is set to non-latest values, i.e. patch / feature / major / minor the lowest matching version is selected, keep current behavior for latest*.

Note that at the time of writing, ADO images contain 10.0.202 but even specifying checkForExistingVersion does not help.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions