From f629969344071865d537daf8e9d668b2e45cae95 Mon Sep 17 00:00:00 2001 From: Cam Soper Date: Thu, 3 Apr 2025 23:53:51 +0000 Subject: [PATCH 1/2] [Breaking change]: --interactive option for dotnet CLI can now default to `true` in user-centric scenarios Fixes #45548 --- docs/core/compatibility/10.0.md | 3 +- .../sdk/10.0/dotnet-cli-interactive.md | 56 +++++++++++++++++++ docs/core/compatibility/toc.yml | 4 ++ 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 docs/core/compatibility/sdk/10.0/dotnet-cli-interactive.md diff --git a/docs/core/compatibility/10.0.md b/docs/core/compatibility/10.0.md index 3176752c55173..c0a522333b500 100644 --- a/docs/core/compatibility/10.0.md +++ b/docs/core/compatibility/10.0.md @@ -2,7 +2,7 @@ title: Breaking changes in .NET 10 titleSuffix: "" description: Navigate to the breaking changes in .NET 10. -ms.date: 03/26/2025 +ms.date: 04/03/2025 ai-usage: ai-assisted no-loc: [Blazor, Razor, Kestrel] --- @@ -51,6 +51,7 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af | Title | Type of change | Introduced version | |----------------------------------------------------------------------------------------------------------------------|---------------------|--------------------| +| [.NET CLI `--interactive` defaults to `true` in user scenarios](sdk/10.0/dotnet-cli-interactive.md) | Behavioral change | Preview 3 | | [Default workload configuration from 'loose manifests' to 'workload sets' mode](sdk/10.0/default-workload-config.md) | Behavioral change | Preview 2 | | [`dotnet restore` audits transitive packages](sdk/10.0/nugetaudit-transitive-packages.md) | Behavioral change | Preview 3 | | [MSBUILDCUSTOMBUILDEVENTWARNING escape hatch removed](sdk/10.0/custom-build-event-warning.md) | Behavioral change | Preview 1 | diff --git a/docs/core/compatibility/sdk/10.0/dotnet-cli-interactive.md b/docs/core/compatibility/sdk/10.0/dotnet-cli-interactive.md new file mode 100644 index 0000000000000..518c4e5e013ab --- /dev/null +++ b/docs/core/compatibility/sdk/10.0/dotnet-cli-interactive.md @@ -0,0 +1,56 @@ +--- +title: "Breaking change - .NET CLI `--interactive` defaults to `true` in user scenarios" +description: "Learn about the breaking change in .NET 10 Preview 3 where the --interactive flag defaults to true in user-centric scenarios." +ms.date: 4/3/2025 +ai-usage: ai-assisted +ms.custom: https://github.com/dotnet/docs/issues/45548 +--- + +# .NET CLI `--interactive` defaults to `true` in user scenarios + +Starting in .NET 10 Preview 3, the `--interactive` flag for the .NET CLI defaults to `true` in user-centric scenarios. This change aims to improve NuGet authentication and enable future CLI features that rely on interactivity. The behavior remains unchanged for CI/CD environments. + +## Version introduced + +.NET 10 Preview 3 + +## Previous behavior + +The `--interactive` flag always defaulted to `false` unless explicitly specified by the user. + +```bash +dotnet restore --interactive +# Required explicitly to enable interactivity +``` + +## New behavior + +The `--interactive` flag defaults to `true` in user-centric scenarios, such as when commands are run directly by a user. In CI/CD environments or when the process output stream is redirected, the flag defaults to `false`. + +```bash +dotnet restore +# Interactivity is enabled by default in user-centric scenarios +``` + +## Type of breaking change + +This is a [behavioral change](../../categories.md#behavioral-change). + +## Reason for change + +This change improves the user experience by: + +- Simplifying NuGet authentication, addressing a common pain point. +- Providing a unified signal for enabling future CLI interactivity features. + +## Recommended action + +No action is required for most users. To explicitly disable interactivity, pass the `--interactive false` flag: + +```bash +dotnet restore --interactive false +``` + +## Affected APIs + +None. diff --git a/docs/core/compatibility/toc.yml b/docs/core/compatibility/toc.yml index 32d74efa8772b..8472dded7cd97 100644 --- a/docs/core/compatibility/toc.yml +++ b/docs/core/compatibility/toc.yml @@ -42,6 +42,8 @@ items: href: globalization/10.0/version-override.md - name: SDK and MSBuild items: + - name: .NET CLI `--interactive` defaults to `true` in user scenarios + href: sdk/10.0/dotnet-cli-interactive.md - name: "`dotnet restore` audits transitive packages" href: sdk/10.0/nugetaudit-transitive-packages.md - name: Default workload configuration from 'loose manifests' to 'workload sets' mode @@ -1910,6 +1912,8 @@ items: items: - name: .NET 10 items: + - name: .NET CLI `--interactive` defaults to `true` in user scenarios + href: sdk/10.0/dotnet-cli-interactive.md - name: "`dotnet restore` audits transitive packages" href: sdk/10.0/nugetaudit-transitive-packages.md - name: Default workload configuration from 'loose manifests' to 'workload sets' mode From dd05f00e546d83d4173cb129904126a4ee571942 Mon Sep 17 00:00:00 2001 From: Cam Soper Date: Fri, 4 Apr 2025 00:23:13 +0000 Subject: [PATCH 2/2] simplify --- docs/core/compatibility/sdk/10.0/dotnet-cli-interactive.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/core/compatibility/sdk/10.0/dotnet-cli-interactive.md b/docs/core/compatibility/sdk/10.0/dotnet-cli-interactive.md index 518c4e5e013ab..c30ac95f61027 100644 --- a/docs/core/compatibility/sdk/10.0/dotnet-cli-interactive.md +++ b/docs/core/compatibility/sdk/10.0/dotnet-cli-interactive.md @@ -8,7 +8,7 @@ ms.custom: https://github.com/dotnet/docs/issues/45548 # .NET CLI `--interactive` defaults to `true` in user scenarios -Starting in .NET 10 Preview 3, the `--interactive` flag for the .NET CLI defaults to `true` in user-centric scenarios. This change aims to improve NuGet authentication and enable future CLI features that rely on interactivity. The behavior remains unchanged for CI/CD environments. +The `--interactive` flag for the .NET CLI now defaults to `true` in user-centric scenarios. The behavior remains unchanged for CI/CD environments. ## Version introduced