Skip to content

Commit 34920af

Browse files
authored
Update file-based program doc (#48943)
1 parent d14b54a commit 34920af

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

documentation/general/dotnet-run-file.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ We call these *file-based programs* (as opposed to *project-based programs*).
77
dotnet run file.cs
88
```
99

10+
See also [IDE spec](https://github.com/dotnet/roslyn/blob/main/docs/features/file-based-programs-vscode.md).
11+
1012
## Motivation
1113

1214
File-based programs
@@ -71,7 +73,7 @@ Internally, the SDK CLI detects entry points by parsing all `.cs` files in the d
7173
and checking which ones contain top-level statements (`Main` methods are not supported for now as that would require full semantic analysis, not just parsing).
7274
Results of this detection are used to exclude other entry points from [builds](#multiple-entry-points) and [app directive collection](#directives-for-project-metadata).
7375
This means the CLI might consider a file to be an entry point which later the compiler doesn't
74-
(for example because its top-level statements are under `#if SYMBOL` and the build has `DefineConstants=SYMBOL`).
76+
(for example because its top-level statements are under `#if !SYMBOL` and the build has `DefineConstants=SYMBOL`).
7577
However such inconsistencies should be rare and hence that is a better trade off than letting the compiler decide which files are entry points
7678
because that could require multiple builds (first determine entry points and then re-build with app directives except those from other entry points).
7779
To avoid parsing all C# files twice (in CLI and in the compiler), the CLI could use the compiler server for parsing so the trees are reused

0 commit comments

Comments
 (0)