Skip to content

Commit ea37c22

Browse files
authored
Merge branch 'main' into patch-7
2 parents 8fc07c9 + fa2361b commit ea37c22

File tree

202 files changed

+4083
-1646
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+4083
-1646
lines changed

.config/dotnet-tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"isRoot": true,
44
"tools": {
55
"microsoft.dotnet.darc": {
6-
"version": "1.1.0-beta.25305.3",
6+
"version": "1.1.0-beta.25312.2",
77
"commands": [
88
"darc"
99
]

documentation/general/dotnet-run-file.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ The command takes a path which can be either
4747
## Target path
4848

4949
The path passed to `dotnet run ./some/path.cs` is called *the target path*.
50-
The target path must be a file which has the `.cs` file extension.
50+
The target path must be a file which either has the `.cs` file extension,
51+
or a file whose contents start with `#!`.
5152
*The target directory* is the directory of the target file.
5253

5354
## Integration into the existing `dotnet run` command
@@ -57,7 +58,7 @@ specifically `file.cs` is passed as the first command-line argument to the targe
5758
We preserve this behavior to avoid a breaking change.
5859
The file-based build and run kicks in only when:
5960
- a project file cannot be found (in the current directory or via the `--project` option), and
60-
- if the target file exists and has the `.cs` file extension.
61+
- if the target file exists, and has the `.cs` file extension or contents that start with `#!`.
6162

6263
File-based programs are processed by `dotnet run` equivalently to project-based programs unless specified otherwise in this document.
6364
For example, the remaining command-line arguments after the first argument (the target path) are passed through to the target app
@@ -71,11 +72,11 @@ We want to report an error for non-entry-point files to avoid the confusion of b
7172

7273
Internally, the SDK CLI detects entry points by parsing all `.cs` files in the directory tree of the entry point file with default parsing options (in particular, no `<DefineConstants>`)
7374
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).
74-
Results of this detection are used to exclude other entry points from [builds](#multiple-entry-points) and [app directive collection](#directives-for-project-metadata).
75+
Results of this detection are used to exclude other entry points from [builds](#multiple-entry-points) and [file-level directive collection](#directives-for-project-metadata).
7576
This means the CLI might consider a file to be an entry point which later the compiler doesn't
7677
(for example because its top-level statements are under `#if !SYMBOL` and the build has `DefineConstants=SYMBOL`).
7778
However such inconsistencies should be rare and hence that is a better trade off than letting the compiler decide which files are entry points
78-
because that could require multiple builds (first determine entry points and then re-build with app directives except those from other entry points).
79+
because that could require multiple builds (first determine entry points and then re-build with file-level directives except those from other entry points).
7980
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
8081
(unless the parse options change via the directives), and also [cache](#optimizations) the results to avoid parsing on subsequent runs.
8182

@@ -86,6 +87,10 @@ other files in the target directory or its subdirectories are included in the co
8687
For example, other `.cs` files but also `.resx` (embedded resources).
8788
Similarly, implicit build files like `Directory.Build.props` or `Directory.Packages.props` are used during the build.
8889

90+
> [!CAUTION]
91+
> Multi-file support is postponed for .NET 11.
92+
> In .NET 10, only the single file passed as the command-line argument to `dotnet run` is part of the compilation.
93+
8994
### Nested files
9095

9196
If there are nested project files like
@@ -146,21 +151,22 @@ They are not cleaned immediately because they can be re-used on subsequent runs
146151

147152
## Directives for project metadata
148153

149-
It is possible to specify some project metadata via *app directives*
154+
It is possible to specify some project metadata via *file-level directives*
150155
which are [ignored][ignored-directives] by the C# language but recognized by the SDK CLI.
151156
Directives `sdk`, `package`, and `property` are translated into `<Project Sdk="...">`, `<PackageReference>`, and `<Property>` project elements, respectively.
152157
Other directives result in an error, reserving them for future use.
153158

154159
```cs
155160
#:sdk Microsoft.NET.Sdk.Web
156-
#:property TargetFramework net11.0
157-
#:property LangVersion preview
161+
#:property TargetFramework=net11.0
162+
#:property LangVersion=preview
158163
159164
```
160165

161-
The value must be separated from the name of the directive by white space (`@` is additionally allowed separator for the package directive)
166+
The value must be separated from the kind (`package`/`sdk`/`property`) of the directive by whitespace
162167
and any leading and trailing white space is not considered part of the value.
163-
Any value can optionally have two parts separated by a space (more whitespace characters could be allowed in the future).
168+
Any value can optionally have two parts separated by `@` in case of `package`/`sdk` or `=` in case of `property`
169+
and whitespace is trimmed from the two parts around the separator.
164170
The value of the first `#:sdk` is injected into `<Project Sdk="{0}">` with the separator (if any) replaced with `/`,
165171
and the subsequent `#:sdk` directive values are split by the separator and injected as `<Sdk Name="{0}" Version="{1}" />` elements (or without the `Version` attribute if there is no separator).
166172
It is an error if the first part (name) is empty (the version is allowed to be empty, but that results in empty `Version=""`).

documentation/manpages/sdk/dotnet-build-server.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
. ftr VB CB
1515
. ftr VBI CBI
1616
.\}
17-
.TH "dotnet-build-server" "1" "2024-10-02" "" ".NET Documentation"
17+
.TH "dotnet-build-server" "1" "2025-05-30" "" ".NET Documentation"
1818
.hy
1919
.SH dotnet build-server
2020
.PP

documentation/manpages/sdk/dotnet-build.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
. ftr VB CB
1515
. ftr VBI CBI
1616
.\}
17-
.TH "dotnet-build" "1" "2024-10-02" "" ".NET Documentation"
17+
.TH "dotnet-build" "1" "2025-05-30" "" ".NET Documentation"
1818
.hy
1919
.SH dotnet build
2020
.PP

documentation/manpages/sdk/dotnet-clean.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
. ftr VB CB
1515
. ftr VBI CBI
1616
.\}
17-
.TH "dotnet-clean" "1" "2024-10-02" "" ".NET Documentation"
17+
.TH "dotnet-clean" "1" "2025-05-30" "" ".NET Documentation"
1818
.hy
1919
.SH dotnet clean
2020
.PP

documentation/manpages/sdk/dotnet-dev-certs.1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
. ftr VB CB
1616
. ftr VBI CBI
1717
.\}
18-
.TH "dotnet-dev-certs" "1" "2024-10-02" "" ".NET Documentation"
18+
.TH "dotnet-dev-certs" "1" "2025-05-30" "" ".NET Documentation"
1919
.hy
2020
.SH dotnet dev-certs
2121
.PP
@@ -119,6 +119,7 @@ successfully removed from the machine.
119119
.PP
120120
Exports the certificate to a file so that it can be used by other tools.
121121
Specify the full path to the exported certificate file, including the file name.
122+
The containing directories must already exist and access to them should be restricted.
122123
The type of certificate files that are created depends on which options are used with \f[V]--export-path\f[R]:
123124
.PP
124125
.TS

documentation/manpages/sdk/dotnet-environment-variables.7

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
. ftr VB CB
1515
. ftr VBI CBI
1616
.\}
17-
.TH "dotnet-environment-variables" "7" "2024-10-02" "" ".NET Documentation"
17+
.TH "dotnet-environment-variables" "7" "2025-05-30" "" ".NET Documentation"
1818
.hy
1919
.SH NAME
2020
.PP
@@ -439,7 +439,7 @@ For more information, see the \f[V]--roll-forward\f[R] option for the \f[V]dotne
439439
If set to \f[V]1\f[R] (enabled), enables rolling forward to a pre-release version from a release version.
440440
By default (\f[V]0\f[R] - disabled), when a release version of .NET runtime is requested, roll-forward will only consider installed release versions.
441441
.PP
442-
For more information, see the \f[V]--roll-forward\f[R] option for the \f[V]dotnet\f[R] command
442+
For more information, see the \f[V]--roll-forward\f[R] option for the \f[V]dotnet\f[R] command.
443443
.SS \f[V]DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX\f[R]
444444
.PP
445445
Disables minor version roll forward, if set to \f[V]0\f[R].

documentation/manpages/sdk/dotnet-format.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
. ftr VB CB
1515
. ftr VBI CBI
1616
.\}
17-
.TH "dotnet-format" "1" "2024-10-02" "" ".NET Documentation"
17+
.TH "dotnet-format" "1" "2025-05-30" "" ".NET Documentation"
1818
.hy
1919
.SH dotnet format
2020
.PP

documentation/manpages/sdk/dotnet-help.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
. ftr VB CB
1515
. ftr VBI CBI
1616
.\}
17-
.TH "dotnet-help" "1" "2024-10-02" "" ".NET Documentation"
17+
.TH "dotnet-help" "1" "2025-05-30" "" ".NET Documentation"
1818
.hy
1919
.SH dotnet help reference
2020
.PP

documentation/manpages/sdk/dotnet-migrate.1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
. ftr VB CB
1515
. ftr VBI CBI
1616
.\}
17-
.TH "dotnet-migrate" "1" "2024-10-02" "" ".NET Documentation"
17+
.TH "dotnet-migrate" "1" "2025-05-30" "" ".NET Documentation"
1818
.hy
1919
.SH dotnet migrate
2020
.PP
@@ -49,7 +49,7 @@ A single project by specifying the \f[I]project.json\f[R] file to migrate.
4949
.IP \[bu] 2
5050
All of the directories specified in the \f[I]global.json\f[R] file by passing in a path to the \f[I]global.json\f[R] file.
5151
.IP \[bu] 2
52-
A \f[I]solution.sln\f[R] file, where it migrates the projects referenced in the solution.
52+
A \f[I]solution.sln(x)\f[R] file, where it migrates the projects referenced in the solution.
5353
.IP \[bu] 2
5454
On all subdirectories of the given directory recursively.
5555
.PP
@@ -72,7 +72,7 @@ a \f[I]project.json\f[R] file to migrate.
7272
.IP \[bu] 2
7373
a \f[I]global.json\f[R] file: the folders specified in \f[I]global.json\f[R] are migrated.
7474
.IP \[bu] 2
75-
a \f[I]solution.sln\f[R] file: the projects referenced in the solution are migrated.
75+
a \f[I]solution.sln(x)\f[R] file: the projects referenced in the solution are migrated.
7676
.IP \[bu] 2
7777
a directory to migrate: recursively searches for \f[I]project.json\f[R] files to migrate inside the specified directory.
7878
.PP

0 commit comments

Comments
 (0)