Run DesignTimeMarkupCompilation when DesignTimeBuild is set. #10489
+2
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes # microsoft/vscode-dotnettools#1018, dotnet/vscode-csharp#5958
Main PR
Description
Roslyn's MSBuildWorkspace, Roslyn LSP ProjectSystem, and (possibly) CPS used in C# DevKit do not want to set BuildingInsideVisualStudio because of all the unknown compatibility issues that might create. By adding the
DesignTimeMarkupCompilation to CoreCompile when a DesignTimeBuild is being performed we will be able to provide our users the ability to open WPF projects and have a good editing experience.
Looks like a previous PR (#1895) enabled this for CPS within VisualStudio and this hopes to do the same for project systems outside VS.
Customer Impact
microsoft/vscode-dotnettools#1018, dotnet/vscode-csharp#5958
Regression
Testing
MSBuildWorkspace has been basically running with this fix for a year (see PR) as it checks whether the DesignTimeMarkupCompilation target exists and runs it. We have not gotten any negative feedback from that change.
Risk
Based on an equivalent change being in Roslyn for a year. I would think the risk was low.
Would love to see this back ported to .NET 8 and 9 as it would enable users on those SDK to open WPF projects.
Microsoft Reviewers: Open in CodeFlow