Fix: use MsBuild Locator rather than embed#10969
Fix: use MsBuild Locator rather than embed#10969dpvreony wants to merge 14 commits intodotnet:mainfrom
Conversation
|
docfx using Microsoft.CodeAnalysis.Workspaces.MSBuild package for metadata extractions. Is registered MSBuild SDK on this PR is actually used for metadata extraction? |
most the code remains the same for metadata, it's just the locator sets up MSBuild rather than it being included in the bin folder. the details are available in https://learn.microsoft.com/en-us/visualstudio/msbuild/find-and-use-msbuild-versions i've tested metadata extraction using https://github.com/dpvreony/Vetuviem with the release version of docfx it fails to "build" the projects due to source generators being involved. with this PR:
i'll look at the other adjustments above |
This is a fairly fundamental change to MsBuild + Roslyn, so appreciate might want to take some time looking at it.
This changes DocFX to use Microsoft.Build.Locator to find the latest applicable version of the .NET SDK or Visual Studio. So the TFM used for the docfx runtime will only find the latest version it can use. (for example the NET8 version complains if you try to scan a net10 project with it as it can only locate net8 etc.) Also added a ForceBuild for cases where some output is not tied to Roslyn, or DesignTime builds.
Fixes #10848, #10808, #10781, #10731, #10901
potentially sorts #10772 and the underlying error seen in #10840 (but not the actual piece about enabling binary logging, though that could be done via a Directory.Build.rsp file next to a project \ solution and the ForceBuild option)
also would give the answer "It just works as long as you use the right TFM (or latest) version of the DocFX runtime" to #8251
Thanks :)