dotnet commands that do an implicit restore don't support --interactive flag
See original GitHub issueSteps to reproduce
Nathans-MBP:test nathan$ dotnet build --interactive
Microsoft (R) Build Engine version 15.8.166+gd4e8d81a88 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1001: Unknown switch.
Switch: --interactive
Expected behavior
I should be able to pass --interactive to build and have it passed to the implicit restore. This makes scenarios with authenticated feeds annoying as I have to explicitly call restore the first time I build.
Actual behavior
Error (see above). A good workaround is adding the following in a Directory.Build.props
<Project>
<PropertyGroup>
<NuGetInteractive>true</NuGetInteractive>
</PropertyGroup>
</Project>
Environment data
dotnet --info
output:
Nathans-MBP:test nathan$ dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 2.1.402
Commit: 3599f217f4
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.14
OS Platform: Darwin
RID: osx-x64
Base Path: /usr/local/share/dotnet/sdk/2.1.402/
Host (useful for support):
Version: 2.1.4
Commit: 85255dde3e
.NET Core SDKs installed:
2.1.402 [/usr/local/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (6 by maintainers)
Top Results From Across the Web
dotnet restore command - .NET CLI
To prevent the implicit NuGet restore, you can use the --no-restore flag with any of these commands.
Read more >dotnet build command - .NET CLI
Implicit restore. Building requires the project.assets.json file, which lists the dependencies of your application. The file is created when ...
Read more >dotnet pack command - .NET CLI
This command supports the dotnet restore options when passed in the long form (for example, --source ). Short form options, such as -s...
Read more >dotnet test command - .NET CLI
Run tests without displaying the Microsoft TestPlatform banner. Available since .NET Core 3.0 SDK. --no-restore. Doesn't execute an implicit ...
Read more >dotnet run command - .NET CLI
Implicit restore. You don't have to run dotnet restore because it's run implicitly by all commands that require a restore to occur, such...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Current state is --interactive is available for build, restore, publish, run, tool install, and workload install. Going to close this as fixed in cleaning up old issues. CC @nkolev92
This confused me again today:
But maybe my SDKs are just outdated or mismatch somewhere…