Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add NuGet.exe to the Developer Command Prompt #7133

Closed
KirillOsenkov opened this issue Jul 20, 2018 · 18 comments
Closed

Add NuGet.exe to the Developer Command Prompt #7133

KirillOsenkov opened this issue Jul 20, 2018 · 18 comments

Comments

@KirillOsenkov
Copy link

Please make NuGet.exe available from the Visual Studio Developer Command Prompt. It's a commonly needed tool and the expectation is that msbuild, dotnet and nuget just work from the command prompt.

@zhili1208
Copy link
Contributor

is there any reason for this? we expect dotnet can replace nuget.exe in the future.

@KirillOsenkov
Copy link
Author

Nuget.exe is a very useful tool used by millions of developers daily, it works for packages.config, project.json and PackageReferences. This need isn't going away anytime soon. Every time I'm on someone's machine helping someone, they take a long time to find NuGet.exe and run it.

There are situations where NuGet.exe works, but msbuild /r or dotnet restore don't.

Most of the users don't complain, so consider me being a voice to represent them. Thanks!

@dotMorten
Copy link

dotMorten commented Nov 18, 2020

Agreed. This has always boggled my mind:
image

we expect dotnet can replace nuget.exe in the future.

Two years later, and it's still not a full replacement (no signing support for instance). Also I doubt it'll ever apply to C++'s .vcxproj projects that uses nuget packages too.

@timheuer
Copy link

Signing is my wish to @dotMorten #9006

@dotMorten
Copy link

@timheuer Agreed it's one of the two reasons I use nuget.exe. The other is I use nuget packages in my C++ projects, and they need explicit restore with nuget.exe or the msbuild-based CI build fails.

@dotMorten
Copy link

@timheuer Signing now works with "dotnet nuget sign". So it's probably just C++ projects left where we need this.

@KirillOsenkov
Copy link
Author

nuget.exe is still needed for two important scenarios:

nuget pack custom.nuspec
nuget push

@timheuer
Copy link

nuget.exe is still needed for two important scenarios:

nuget pack custom.nuspec

dotnet pack myproj.csproj /p:NuspecFile=custom.nuspec

nuget push

dotnet nuget push ...

Solved?

@KirillOsenkov
Copy link
Author

Not really. I don't want to have myproj.csproj. It's not a C# project. The fact that you need to have myproj.csproj to pack is a hack.

@nkolev92
Copy link
Member

nkolev92 commented Aug 3, 2022

Correlating this issue to #4254.

I think it'd be great if #4254 is completed over this.

@KirillOsenkov
Copy link
Author

#4254 would solve nuget pack, but it wouldn’t solve nuget push and nuget list.

@zivkan
Copy link
Member

zivkan commented Aug 4, 2022

dotnet nuget push has existed since .NET Core 3.1 SDK. I'm not aware of any functionality differences between dotnet nuget push and nuget.exe push, except that the dotnet CLI uses more GNU style arguments, whereas nuget.exe uses PowerShell style arguments. But there's a 1:1 mapping between the two.

#6060 is the proposed replacement for list

@dotMorten
Copy link

@civkan package signing is one difference and I think there might be a few more. And it’s weird to use dotnet nuget to restore nuget packages for c++ projects (don’t even think that would work)

@zivkan
Copy link
Member

zivkan commented Aug 4, 2022

does msbuild -t:restore -p:RestorePackagesConfig=true work? https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore#restore-using-msbuild.

dotnet nuget sign was added in the .NET 6 SDK.

@nkolev92
Copy link
Member

nkolev92 commented Aug 5, 2022

I took a look at all the NuGet.exe commands and generated a table for the behaviors

Command Name Description NuGet.exe dotnet.exe msbuild.exe Notes
add add package to hierarchical source Yes No N/A Parity not reached. No community asks I could find.
client-certs Client certs management Yes Yes N/A Full parity.
config Individual config items management Yes No. Community ask in 4855 N/A No parity.
delete Unlist package Yes Yes N/A Full Parity
init init packages to a hierarchical source Yes No N/A Parity not reached. No community asks I could find.
install Downloads a package and it's dependencies or run restore Yes Partially. No community ask for the install package. N/A Parity not reached. Not community asks for this
list Search in sources Yes No N/A No parity.
locals local folders and caches Yes Yes N/A Full parity
pack pack nuspec/csproj Yes Yes 4254 is a gap. Yes, msbuild will only ever support PackageReference pack. Parity not reached. Scenario without parity has an easy workaround.
push push package Yes Yes N/A Full parity
restore restore package Yes, both PR & PC Yes (no PC support) Yes, both PR and PC, PC is opt-in Scoped parity. What this means is that dotnet.exe does not support old style, so there's no point to add restore support for that there.
search Search in sources Yes No N/A No parity.
setapikey set api key in config Yes No N/A No parity
sign Sign package Yes Yes N/A Full parity
sources manage sources Yes Yes N/A Full parity
spec creates nuspec Yes No N/A No community asks
trusted-signers manage trusted signers config Yes Yes N/A yes
update updates Yes No N/A Not full parity, but the commands will work totally differently. Think packages.config vs PR. nuget.exe update never worked 100% correctly.
verify verify packages Yes Yes N/A Full parity

Digesting the above table leads to the following list of relevant community requested issues, related to pack nuspec, setapikey, config, update and search commands

@dotMorten
Copy link

Even if the feature gap was closed, it still seems rather silly to me that you have to install the dotnet 6+ sdk just to restore or create nuget packages for non-dotnet projects (C++, .NET Framework etc).

@nkolev92
Copy link
Member

Team Triage:
NuGet.exe can be downloaded from https://www.nuget.org/downloads. At this point we do not have any plans to add NuGet.exe to Visual Studio.

@nkolev92 nkolev92 added the Resolution:ByDesign This issue appears to be ByDesign label Sep 26, 2022
@fowl2
Copy link

fowl2 commented Sep 29, 2022

Many, many components currently bundled with Visual Studio are downloadable separately. I'm not sure that's a compelling reason.

Note that "being able to run the command you found in the article you found online" and "not learn an alternative syntax" are a features not listed in the above table :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants