Skip to content
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

Provide an Escape Hatch for SolutionProjectType.KnownToBeMSBuildFormat #5931

Open
aolszowka opened this issue Dec 4, 2020 · 0 comments
Open
Labels
bug needs-design Requires discussion with the dev team before attempting a fix. triaged
Milestone

Comments

@aolszowka
Copy link

The Short

There should be some type of escape hatch to allow new project system types to be detected as Solution.KnownToBeMSBuildFormat the current system of getting on the blessed list probably is not the most efficient way to do things:

if ((String.Equals(projectTypeGuid, vbProjectGuid, StringComparison.OrdinalIgnoreCase)) ||
(String.Equals(projectTypeGuid, csProjectGuid, StringComparison.OrdinalIgnoreCase)) ||
(String.Equals(projectTypeGuid, cpsProjectGuid, StringComparison.OrdinalIgnoreCase)) ||
(String.Equals(projectTypeGuid, cpsCsProjectGuid, StringComparison.OrdinalIgnoreCase)) ||
(String.Equals(projectTypeGuid, cpsVbProjectGuid, StringComparison.OrdinalIgnoreCase)) ||
(String.Equals(projectTypeGuid, cpsFsProjectGuid, StringComparison.OrdinalIgnoreCase)) ||
(String.Equals(projectTypeGuid, fsProjectGuid, StringComparison.OrdinalIgnoreCase)) ||
(String.Equals(projectTypeGuid, dbProjectGuid, StringComparison.OrdinalIgnoreCase)) ||
(String.Equals(projectTypeGuid, vjProjectGuid, StringComparison.OrdinalIgnoreCase)) ||
(String.Equals(projectTypeGuid, synProjectGuid, StringComparison.OrdinalIgnoreCase)))
{
proj.ProjectType = SolutionProjectType.KnownToBeMSBuildFormat;
}

The Long

A bunch of tooling, both inside and outside of Microsoft leverage code similar to the following:

SolutionFile.Parse("Solution.sln")
.ProjectsInOrder
.Where(p => p.ProjectType == SolutionProjectType.KnownToBeMSBuildFormat)

Right, wrong, or whatever, the die has been cast.

For various ISV's that have extended the Project System, unless you're willing to dump a PR on Microsoft (like we had our ISV do here: #5698) you are outta luck.

As more and more tooling starts to crop up which has this expectation a lot of people are going to get a bunch of undefined behavior unless they're smart enough to realize what is going on.

See the following:

We have been encountering this as we push forward with attempting /graphBuild internally, and while we got a PR accepted that fixed our projects, how do we help the next guy? I am sure there are more than just the list above.

One solution is to try and have an "escape hatch", historically this would have been something like a Registry key, however with the transition into a more platform agnostic MSBuild this probably has fallen out of favor. What is the best possible solution that gives people the ability to register themselves as an SolutionProjectType.KnownToBeMSBuildFormat short of making the if check any longer?

@aolszowka aolszowka added bug needs-triage Have yet to determine what bucket this goes in. labels Dec 4, 2020
@benvillalobos benvillalobos added needs-design Requires discussion with the dev team before attempting a fix. and removed needs-triage Have yet to determine what bucket this goes in. labels Dec 9, 2020
@benvillalobos benvillalobos added this to the Backlog milestone Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs-design Requires discussion with the dev team before attempting a fix. triaged
Projects
None yet
Development

No branches or pull requests

3 participants