-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Test MSBuildWorkspace opening dotnet new projects.
#69225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thanks for the review @sharwell! I have updated with your suggestions. |
|
|
||
| var targets = new[] { TargetNames.Compile, TargetNames.CoreCompile }; | ||
| var requiredTargets = new[] { TargetNames.Compile, TargetNames.CoreCompile }; | ||
| var optionalTargets = new[] { TargetNames.DesignTimeMarkupCompilation }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 It looks like if we set BuildingInsideVisualStudio to true, this will run automatically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll merge in the changes from #57219 and close that one out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, after testing locally, setting BuildingInsideVisualStudio breaks the blazor and blazorwasm scenarios. Will have to dig a bit to understand why.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sharwell Setting BuildingInsideVisualStudio causes the RazorSourceGenerator.razorencconfig file to be added as an AnalyzerConfig, which then adds build_property.SuppressRazorSourceGenerator = true to the configuration. I noticed Roslyn's feature layer has a class dedicated to removing this config file from the Solution (https://github.com/dotnet/roslyn/blob/f5b6c715a742c56b7cc672e47385508fb4df98cc/src/Features/Core/Portable/Workspace/CompileTimeSolutionProvider.cs). I think we should take the change as is until Razor has sorted out their design time build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidwengier Do you know the status of the Razor design time build work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There won't be any change Razor design time code gen in the short term.
Additionally the last time someone tried to change whether BuildingInsideVisualStudio was set it broke dotnet watch and various VS Code things, from memory.
23db666 to
183fada
Compare
src/Workspaces/MSBuildTest/Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests.csproj
Outdated
Show resolved
Hide resolved
src/Workspaces/MSBuildTest/Utilities/DotNetSdkMSBuildInstalled.cs
Outdated
Show resolved
Hide resolved
e437a14 to
c3b7a08
Compare
src/Workspaces/MSBuildTest/NewlyCreatedProjectsFromDotNetNew.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/Core/MSBuild.BuildHost/Build/ProjectBuildManager.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/MSBuildTest/NewlyCreatedProjectsFromDotNetNew.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/MSBuildTest/NewlyCreatedProjectsFromDotNetNew.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/MSBuildTest/NewlyCreatedProjectsFromDotNetNew.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/MSBuildTest/NewlyCreatedProjectsFromDotNetNew.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/MSBuildTest/NewlyCreatedProjectsFromDotNetNew.cs
Outdated
Show resolved
Hide resolved
The DotNetSdkLocator was coded to expect the the normal development layout of files, the test assembly is deeply nested under /artifacts. The Helix layout is quite different with test assemblies nested much shallower. Workspacese need to support both environments and this can be acheived by walking up the filesystem from the test assembly.
0fe481c to
29ec1ac
Compare
dotnet-format uses MSBuildWorkspace and needs to support the common .NET SDK scenarios, including WPF.
DesignTimeMarkupCompilationto support WPF scenarios.Fixes dotnet/format#1402