microsoft / MSBuildLocator

An API to locate MSBuild assemblies from an installed Visual Studio location. Use this to ensure that calling the MSBuild API will use the same toolset that a build from Visual Studio or msbuild.exe would.
Other
212 stars 83 forks source link

Make Unregister a no-op Fixes #77 #204

Closed Forgind closed 11 months ago

Forgind commented 1 year ago

Unregister currently looks to see if we had previously registered MSBuild, and if so, it undoes our resolver but leaves IsRegistered set to true. This basically means we can't unregister then re-register it, at least not via MSBuildLocator. One fix could be ensuring that IsRegistered is set to false at the end of Unregister, but since we no longer register specific assemblies anyway, making it a no-op seems more reasonable. There's no need to unregister anyway.

yaakov-h commented 1 year ago

Can it be given ObsoleteAttribute as well, and/or hidden with EditorBrowsable?

Forgind commented 1 year ago

Can it be given ObsoleteAttribute as well, and/or hidden with EditorBrowsable?

Obsolete would throw a warning, so I don't think I can do that, but I think EditorBrowsable is fine! Thanks for the suggestion!

rainersigwald commented 1 year ago

Agreed (though we can think about having a less aggressive breaking change policy in this repo than in MSBuild proper).