question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet commands that do an implicit restore don't support --interactive flag

See original GitHub issue

Steps 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:closed
  • Created 5 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
marcpopMSFTcommented, Aug 24, 2021

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

0reactions
LXBdevcommented, Jul 10, 2019

This confused me again today:

dotnet build C:\Program Files\dotnet\sdk\2.1.700\NuGet.targets(121,5): warning : The plugin credential provider could not acquire credentials. Authentication may require manual action. Consider re-running the command with --interactive for dotnet, /p:NuGetInteractive=“true” for MSBuild or removing the -NonInteractive switch for NuGet […csproj]

dotnet build --interactive Microsoft ® Build Engine version 16.1.76+g14b0a930a7 for .NET Core Copyright © Microsoft Corporation. All rights reserved. MSBUILD : error MSB1001: Unknown switch. Switch: --interactive

But maybe my SDKs are just outdated or mismatch somewhere…

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found