In a similar vein to #128, and regarding recent issues we've had with updated internal tools and the subsequent discussion at https://github.com/microsoft/MSBuildLocator/pull/184, we should forbid calling Microsoft.Build.Locator.MSBuildLocator.RegisterDefault().
I don't want to use the regular BannedApiAnalyzer for this as it requires somebody to go and add the banned API to BannedAPIs.txt in the repo. Lately, internal tools are being built in standalone repos all over the show, so it's not a simple case of adding this to the root of any of our existing product repositories.
I don't think a code fix is strictly necessary here, but perhaps we could provide one to either use the internal helper from DevTools (I think we publish that via internal NuGet), or to transform the invocation into a full LINQ expression along the lines of (pseudocode-ish):
In a similar vein to #128, and regarding recent issues we've had with updated internal tools and the subsequent discussion at https://github.com/microsoft/MSBuildLocator/pull/184, we should forbid calling
Microsoft.Build.Locator.MSBuildLocator.RegisterDefault()
.I don't want to use the regular BannedApiAnalyzer for this as it requires somebody to go and add the banned API to
BannedAPIs.txt
in the repo. Lately, internal tools are being built in standalone repos all over the show, so it's not a simple case of adding this to the root of any of our existing product repositories.I don't think a code fix is strictly necessary here, but perhaps we could provide one to either use the internal helper from DevTools (I think we publish that via internal NuGet), or to transform the invocation into a full LINQ expression along the lines of (pseudocode-ish):