You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/general/dotnet-run-file.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -289,16 +289,16 @@ The build is performed using MSBuild APIs on in-memory project files.
289
289
If an up-to-date check detects that inputs didn't change in subsequent `dotnet run file.cs` invocations,
290
290
building is skipped (as if `--no-build` option has been passed).
291
291
The up-to-date check is not 100% precise (e.g., files imported through an implicit build file are not considered).
292
-
It is possible to enforce a full build using `--no-cache` flag or `dotnet build file.cs`.
292
+
It is possible to enforce a full build using `--no-cache` flag or `dotnet build file.cs`
293
+
(for a more permanent opt-out, there is MSBuild property `FileBasedProgramCanSkipMSBuild=false`).
293
294
Environment variable [`DOTNET_CLI_CONTEXT_VERBOSE=true`][verbose-env] can be used to get more details about caching decisions made by `dotnet run file.cs`.
294
295
295
296
There are multiple optimization levels - skipping build altogether, running just the C# compiler, or running full MSBuild.
296
297
We always need to re-run MSBuild if implicit build files like `Directory.Build.props` change but
297
298
from `.cs` files, the only relevant MSBuild inputs are the `#:` directives,
298
299
hence we can first check the `.cs` file timestamps and for those that have changed, compare the sets of `#:` directives.
299
300
If only `.cs` files change, it is enough to invoke `csc.exe` (directly or via a build server)
300
-
re-using command-line arguments that the last MSBuild invocation passed to the compiler
301
-
(you can opt out of this via an MSBuild property `FileBasedProgramCanSkipMSBuild=false`).
301
+
re-using command-line arguments that the last MSBuild invocation passed to the compiler.
302
302
If no inputs change, it is enough to start the target executable without invoking the build at all.
0 commit comments