-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Disable static graph restore for file-based apps #50245
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR disables static graph restore for file-based apps to resolve issue #49876. The change prevents MSBuild from using static graph evaluation during restore operations for C# files that are run directly without a project file.
- Adds
RestoreUseStaticGraphEvaluation>false
property to virtual project files generated for file-based apps - Includes test coverage for both implicit and explicit static graph restore scenarios
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs | Adds property to disable static graph evaluation in generated virtual project files |
test/dotnet.Tests/CommandTests/Run/RunFileTests.cs | Adds tests to verify static graph restore behavior and updates existing test project templates |
@@ -891,6 +891,7 @@ public static void WriteProjectFile( | |||
writer.WriteLine(""" | |||
<EnableDefaultCompileItems>false</EnableDefaultCompileItems> | |||
<DisableDefaultItemsInProjectFolder>true</DisableDefaultItemsInProjectFolder> | |||
<RestoreUseStaticGraphEvaluation>false</RestoreUseStaticGraphEvaluation> |
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.
Should we try looking through the property directives and seeing if any of them are an explicit enable of static graph, and give a more reasonable error if so? Or is it too niche?
Closes #49876.