From 4b911296571956436b3e8408d5014cfe93156b42 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 22 Dec 2025 23:17:57 +0000 Subject: [PATCH 1/3] Initial plan From 53dca0439030ef2708e9c2e752bf896df24e07d6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 22 Dec 2025 23:21:06 +0000 Subject: [PATCH 2/3] Clarify information in file-based apps documentation Co-authored-by: meaghanlewis <10103121+meaghanlewis@users.noreply.github.com> --- docs/core/sdk/file-based-apps.md | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/docs/core/sdk/file-based-apps.md b/docs/core/sdk/file-based-apps.md index fce2cf155d3e2..450d0991cf33c 100644 --- a/docs/core/sdk/file-based-apps.md +++ b/docs/core/sdk/file-based-apps.md @@ -32,6 +32,9 @@ Adds a NuGet package reference to your application. #:package Serilog@3.1.1 ``` +> [!NOTE] +> Omitting the version number (for example, `#:package Newtonsoft.Json`) currently only works when you use central package management with a `Directory.Packages.props` file. Otherwise, specify the version explicitly (for example, `#:package Newtonsoft.Json@13.0.3`). + ### `#:project` References another project file or directory that contains a project file. @@ -90,12 +93,6 @@ Pass arguments to your application by placing them after `--`: dotnet run file.cs -- arg1 arg2 ``` -Without `--`, arguments go to the `dotnet run` command: - -```dotnetcli -dotnet run file.cs arg1 arg2 -``` - #### Pipe code from stdin 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. @@ -191,12 +188,11 @@ File-based apps automatically include specific file types for compilation and pa By default, the following items are included: - The single C# file itself. -- ResX resource files in the same directory. Different SDKs include other file types: - `Microsoft.NET.Sdk.Web` includes `*.json` configuration files. -- Other specialized SDKs might include other patterns. +- Non-default SDKs might include ResX resource files and other patterns. ## Native AOT publishing @@ -373,12 +369,6 @@ Caching improves build performance but can cause confusion when: dotnet clean file-based-apps ``` -- Run a full build by using the `--no-cache` flag: - - ```dotnetcli - dotnet build file.cs --no-cache - ``` - - Force a clean build to bypass cache: ```dotnetcli From 646a16228cb8ce2a31a3c4a3932db7bf12583c6c Mon Sep 17 00:00:00 2001 From: "Meaghan Osagie (Lewis)" Date: Mon, 22 Dec 2025 16:06:13 -0800 Subject: [PATCH 3/3] Update package management notes and default items Clarified notes on omitting version numbers for packages and updated default included items for file-based apps. --- docs/core/sdk/file-based-apps.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/core/sdk/file-based-apps.md b/docs/core/sdk/file-based-apps.md index 450d0991cf33c..c50437641ab47 100644 --- a/docs/core/sdk/file-based-apps.md +++ b/docs/core/sdk/file-based-apps.md @@ -30,10 +30,11 @@ Adds a NuGet package reference to your application. ```csharp #:package Newtonsoft.Json #:package Serilog@3.1.1 +#:package Spectre.Console@* ``` > [!NOTE] -> Omitting the version number (for example, `#:package Newtonsoft.Json`) currently only works when you use central package management with a `Directory.Packages.props` file. Otherwise, specify the version explicitly (for example, `#:package Newtonsoft.Json@13.0.3`). +> 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. ### `#:project` @@ -185,14 +186,12 @@ By default, restore runs implicitly when you build or run your application. Howe File-based apps automatically include specific file types for compilation and packaging. -By default, the following items are included: - -- The single C# file itself. +By default, the single C# file is included. Different SDKs include other file types: - `Microsoft.NET.Sdk.Web` includes `*.json` configuration files. -- Non-default SDKs might include ResX resource files and other patterns. +- Non-default SDKs include ResX resource files. ## Native AOT publishing