Repository navigation
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses #54551 by ensuring file-based dotnet run re-evaluates the virtual project to compute RunCommand when properties change under --no-build, aligning behavior more closely with project-based runs. It also lifts the previous restriction that prevented combining --no-build and --no-cache for file-based apps, with updated tests to validate the new behavior.
Changes:
- Allow
dotnet run --no-build --no-cache(previously rejected) and adjust file-based run-property caching logic to re-evaluate when inputs/global properties change. - Add/relocate tests to validate cached vs re-evaluated
RunCommandbehavior for file-based apps, including--no-buildscenarios. - Update internal
RunCommand.GetTargetCommand(...)call sites to include the newrunPropertiesFromEvaluationflag (used for verbose diagnostics).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/dotnet.Tests/CommandTests/Run/RunFileTests_CscOnlyAndApi.cs | Removes the now-obsolete test that asserted --no-build and --no-cache are invalid together. |
| test/dotnet.Tests/CommandTests/Run/RunFileTests_BuildCommands.cs | Adds coverage for RunCommand caching vs re-evaluation, including property changes under --no-build and --no-cache. |
| test/dotnet.Tests/CommandTests/Run/RunCommandTests.cs | Updates tests for the new GetTargetCommand signature. |
| src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs | Refactors build-level computation and exposes it for --no-build run-property checks; adjusts --no-cache behavior. |
| src/Cli/dotnet/Commands/Run/RunCommand.cs | Removes the --no-build+--no-cache exception; reworks --no-build file-based path to re-evaluate when run properties may be stale. |
| src/Cli/dotnet/Commands/Run/Api/RunApiCommand.cs | Updates call site for the new GetTargetCommand signature. |
| } | ||
|
|
||
| Debug.Assert(buildLevel is BuildLevel.All or BuildLevel.Csc); | ||
| Debug.Assert(result != 0); | ||
| } |
There was a problem hiding this comment.
Good catch; that's a pre-existing issue, but I guess I can fix it in this PR since I'm touching caching code anyway. I don't think it's actually observable currently though (so I'm not adding a test for it).
|
@RikkiGibson for a second review, thanks |
3 similar comments
|
@RikkiGibson for a second review, thanks |
|
@RikkiGibson for a second review, thanks |
|
@RikkiGibson for a second review, thanks |
Fixes #54551.
Review tips: commit-by-commit; ignore whitespace.