Skip to content

Commit 37c026f

Browse files
Clarify file-based apps documentation per PR feedback (#50723)
* Initial plan * Clarify information in file-based apps documentation Co-authored-by: meaghanlewis <[email protected]> * Update package management notes and default items Clarified notes on omitting version numbers for packages and updated default included items for file-based apps. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: meaghanlewis <[email protected]> Co-authored-by: Meaghan Osagie (Lewis) <[email protected]>
1 parent a5fd0e2 commit 37c026f

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

docs/core/sdk/file-based-apps.md

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ Adds a NuGet package reference to your application.
3030
```csharp
3131
#:package Newtonsoft.Json
3232
33+
#:package Spectre.Console@*
3334
```
3435

36+
> [!NOTE]
37+
> Omitting the version number after the package name currently only works when you use central package management with a `Directory.Packages.props` file. Otherwise, specify the version number explicitly, or add `@*` after the package name to use the latest version.
38+
3539
### `#:project`
3640

3741
References another project file or directory that contains a project file.
@@ -90,12 +94,6 @@ Pass arguments to your application by placing them after `--`:
9094
dotnet run file.cs -- arg1 arg2
9195
```
9296

93-
Without `--`, arguments go to the `dotnet run` command:
94-
95-
```dotnetcli
96-
dotnet run file.cs arg1 arg2
97-
```
98-
9997
#### Pipe code from stdin
10098

10199
Pipe C# code directly to `dotnet run` by using standard input with the `-` argument. The `-` argument indicates that `dotnet run` reads the code from standard input instead of a file. With the `-` argument, `dotnet run` doesn't search the current working directory for other files, such as launch profiles. The current directory is still the working directory to build and run the program.
@@ -188,15 +186,12 @@ By default, restore runs implicitly when you build or run your application. Howe
188186

189187
File-based apps automatically include specific file types for compilation and packaging.
190188

191-
By default, the following items are included:
192-
193-
- The single C# file itself.
194-
- ResX resource files in the same directory.
189+
By default, the single C# file is included.
195190

196191
Different SDKs include other file types:
197192

198193
- `Microsoft.NET.Sdk.Web` includes `*.json` configuration files.
199-
- Other specialized SDKs might include other patterns.
194+
- Non-default SDKs include ResX resource files.
200195

201196
## Native AOT publishing
202197

@@ -373,12 +368,6 @@ Caching improves build performance but can cause confusion when:
373368
dotnet clean file-based-apps
374369
```
375370

376-
- Run a full build by using the `--no-cache` flag:
377-
378-
```dotnetcli
379-
dotnet build file.cs --no-cache
380-
```
381-
382371
- Force a clean build to bypass cache:
383372

384373
```dotnetcli

0 commit comments

Comments
 (0)