Skip to content

Commit 13affef

Browse files
author
Cam Soper
authored
[Breaking change]: --interactive option for dotnet CLI can now default to true in user-centric scenarios (#45628)
* [Breaking change]: --interactive option for dotnet CLI can now default to `true` in user-centric scenarios Fixes #45548 * simplify
1 parent c9d025d commit 13affef

File tree

3 files changed

+62
-1
lines changed

3 files changed

+62
-1
lines changed

docs/core/compatibility/10.0.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Breaking changes in .NET 10
33
titleSuffix: ""
44
description: Navigate to the breaking changes in .NET 10.
5-
ms.date: 03/26/2025
5+
ms.date: 04/03/2025
66
ai-usage: ai-assisted
77
no-loc: [Blazor, Razor, Kestrel]
88
---
@@ -51,6 +51,7 @@ If you're migrating an app to .NET 10, the breaking changes listed here might af
5151

5252
| Title | Type of change | Introduced version |
5353
|----------------------------------------------------------------------------------------------------------------------|---------------------|--------------------|
54+
| [.NET CLI `--interactive` defaults to `true` in user scenarios](sdk/10.0/dotnet-cli-interactive.md) | Behavioral change | Preview 3 |
5455
| [Default workload configuration from 'loose manifests' to 'workload sets' mode](sdk/10.0/default-workload-config.md) | Behavioral change | Preview 2 |
5556
| [`dotnet restore` audits transitive packages](sdk/10.0/nugetaudit-transitive-packages.md) | Behavioral change | Preview 3 |
5657
| [MSBUILDCUSTOMBUILDEVENTWARNING escape hatch removed](sdk/10.0/custom-build-event-warning.md) | Behavioral change | Preview 1 |
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
title: "Breaking change - .NET CLI `--interactive` defaults to `true` in user scenarios"
3+
description: "Learn about the breaking change in .NET 10 Preview 3 where the --interactive flag defaults to true in user-centric scenarios."
4+
ms.date: 4/3/2025
5+
ai-usage: ai-assisted
6+
ms.custom: https://github.com/dotnet/docs/issues/45548
7+
---
8+
9+
# .NET CLI `--interactive` defaults to `true` in user scenarios
10+
11+
The `--interactive` flag for the .NET CLI now defaults to `true` in user-centric scenarios. The behavior remains unchanged for CI/CD environments.
12+
13+
## Version introduced
14+
15+
.NET 10 Preview 3
16+
17+
## Previous behavior
18+
19+
The `--interactive` flag always defaulted to `false` unless explicitly specified by the user.
20+
21+
```bash
22+
dotnet restore --interactive
23+
# Required explicitly to enable interactivity
24+
```
25+
26+
## New behavior
27+
28+
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`.
29+
30+
```bash
31+
dotnet restore
32+
# Interactivity is enabled by default in user-centric scenarios
33+
```
34+
35+
## Type of breaking change
36+
37+
This is a [behavioral change](../../categories.md#behavioral-change).
38+
39+
## Reason for change
40+
41+
This change improves the user experience by:
42+
43+
- Simplifying NuGet authentication, addressing a common pain point.
44+
- Providing a unified signal for enabling future CLI interactivity features.
45+
46+
## Recommended action
47+
48+
No action is required for most users. To explicitly disable interactivity, pass the `--interactive false` flag:
49+
50+
```bash
51+
dotnet restore --interactive false
52+
```
53+
54+
## Affected APIs
55+
56+
None.

docs/core/compatibility/toc.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ items:
4242
href: globalization/10.0/version-override.md
4343
- name: SDK and MSBuild
4444
items:
45+
- name: .NET CLI `--interactive` defaults to `true` in user scenarios
46+
href: sdk/10.0/dotnet-cli-interactive.md
4547
- name: "`dotnet restore` audits transitive packages"
4648
href: sdk/10.0/nugetaudit-transitive-packages.md
4749
- name: Default workload configuration from 'loose manifests' to 'workload sets' mode
@@ -1914,6 +1916,8 @@ items:
19141916
items:
19151917
- name: .NET 10
19161918
items:
1919+
- name: .NET CLI `--interactive` defaults to `true` in user scenarios
1920+
href: sdk/10.0/dotnet-cli-interactive.md
19171921
- name: "`dotnet restore` audits transitive packages"
19181922
href: sdk/10.0/nugetaudit-transitive-packages.md
19191923
- name: Default workload configuration from 'loose manifests' to 'workload sets' mode

0 commit comments

Comments
 (0)