Open ericstj opened 2 months ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
Version Used: 4.11.0
Steps to Reproduce:
Diagnostic Id:
Expected Behavior: Do we really need all these assemblies exposed to the consuming project? I thought the purpose of this component was to avoid exposing MSBuild details to the caller and instead load from out-of-proc using a host with MSBuildLocator.
I think we should have minimal depdencies here. Seems all but
Microsoft.Build.Framework
could be made PrivateAssetsActual Behavior: All of MSBuild including it's runtime dependencies are exposed to consumers.
I did a quick and dirty experiment where I ran GenAPI on Microsoft.CodeAnalysis.Workspaces.MSBuild to see what of MSBuild it actually exposes to users. It seems the only type is
Microsoft.Build.Framework.ILogger
. Here's that prototype: wsRefProto.zipI also disassembled Microsoft.CodeAnalysis.Workspaces.MSBuild to see what types it was actually using in the runtime implementation. Seems it's only using:
So you can at the very least remove your references to https://github.com/dotnet/roslyn/blob/7b75058bf667721fb985519fe800ffe44580457a/src/Workspaces/Core/MSBuild/Microsoft.CodeAnalysis.Workspaces.MSBuild.csproj#L26
If you made proxy types for those and loaded through reflection (from wherever the locator found them) you could also remove the
Microsoft.Build
dependency.If you made an API breaking change, you could replace the ILogger dependency with a wrapper and remove the Microsoft.Build.Framework dependency.