msbuild icon indicating copy to clipboard operation
msbuild copied to clipboard

Consider adding "accepted SDK name match pattern" to SDK manifests

Open rainersigwald opened this issue 4 years ago • 2 comments

Currently, we try SDK resolvers based on which are resolved, and their self-defined priority order. But that means that (for example) we must load the NuGet SDK resolver even for projects that don't use it, because we can't know in advance that (for example) the .NET SDK resolver will be sufficient.

We could add a name pattern to the registration and search by longest-match first.

It could be something like

  • .NET SDK Resolver: Microsoft.NET.*
  • NuGet resolver: *

Then if we're trying to resolve Microsoft.NET.SDK it'll match against the former and we won't even have to load the latter.

(this is based on ideas from and discussion with @olgaark)

rainersigwald avatar Jan 13 '22 22:01 rainersigwald

@olgaark, I opened a PR for this issue: #7597. Here is the spec file with the description of the new resolving algorithm. The main change from the initial idea is that we decided to go with regex instead of wildcards. Feel free to review & discuss the decisions we have made for this change.

AR-May avatar May 10 '22 16:05 AR-May

@AR-May Thanks! The design looks good to me

olgaark avatar May 10 '22 17:05 olgaark