-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query options and sorting #68
Comments
The philosophy so far has been to push this onto the calling code, allowing it to get a list of options and filter/sort that in its own way. MSBuildLocator/samples/BuilderApp/Program.cs Lines 26 to 27 in 8b5c58f
Do you think there's a better API that we could provide? What would that look like? |
The problem with "Ask what to use" is that it may not be interactive. From an API perspective, I think filters could be added to the query option. It would make it declarative, "give me 2019 or return emtpy if not found" |
Another idea, which could be combined with the query option, is to add additional properties to the instance objects, for the version number and channel name. I realize that |
I'd be on board with adding fields to our object to make filtering easier. Unfortunately, the things you're interested in don't seem to be available in Adding filtering options to the query doesn't strike me as better than letting the caller do it, though. |
Does one of those at least indicate the channel name & stable/pre-release-ness? That'd be a good starting point. |
Not that I can see. The only "properties" I see are:
|
How does |
Happened to be looking at something nearby today, and noticed that the sample VS Setup API application emits some information that looks related to these things. Evidently and one of these catalog properties is probably channel-like:
Eyeballing against my internal-preview install, I think I'm trying to decide if we should expose certain fields directly, or just return the whole |
The ability to filter to require workloads/components is important, too. Finding the wrong VS Build Tools installation was the cause of the On a build server with:
|
Would you accept a PR to expose the information in Optionally, new APIs roughly like this could be added to make this (hopefully common) usage easier: MSBuildLocator.RegisterLatest(new VisualStudioInstanceQueryOptions
{
RequiredComponents = { RequiredComponent.DotNetSdk },
}); |
Yes.
That is slick--but where are the components defined? I'd rather not have to replicate lists from VS Setup if we can delegate to it. |
There's a similar problem for locating and selecting preview .NET SDKs, as logged in tintoy/msbuild-project-tools-vscode#144. The current logic asks the hostfxr to list SDKs, but the hostfxr call doesn't seem to support listing previews through the APIs. I haven't checked yet to see if the rollforward selection environment variables can influence this call, though. There's a separate hostfxr call that can do selection of the correct SDK including previews, but that doesn't seem to be a 1;1 match with the call we're using now, so we may need the runtime to fill this gap. |
Hi @clairernovotny, The ability to query preview versions was added in the recent package: Please let us know if it partially resolves your request. |
Feel free to reopen and specify what else is missing for your current needs. |
As far as I've seen, there's no way to sort or filter on VS options.
The following would be useful:
The text was updated successfully, but these errors were encountered: