-
Notifications
You must be signed in to change notification settings - Fork 251
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
Please provide capability in Nuget CLI to add packages into projects #12204
Comments
I've been looking into this a bit more and there is absolutely no way to automate adding Nuget packages to projects now. If doing so with For example, this command almost works in Command Prompt, but it runs the command before the package manager console is fully set up and reports an object reference error.
Can you maybe update the package manager console to run the command passed the way it is described after the console has been set up? This would allow automating installing packages using this command, followed by Exit, like this:
Anything, really, would be great because there is no way to automate installing Nuget projects today, which is probably the only package manager there is with this shortcoming. I would use patching, but .vcxproj files may contain absolute paths, such as those generated by CMake and they are not patchable. |
Package Installation for packages.config projects involved calling components in Visual Studio that simply not available in NuGet.exe. NuGet.exe will never have enough information to make the Visual Studio and NuGet.exe instllations be equivalent. Furthermore, installation scripts are not supported on the commandline (packages.config projects) while they are in Visual Studio. As such, this is not something we want to be adding to NuGet.exe at this point. |
That's hugely disappointing. This would allow CMake to implement much better packager than what they do today, which to scan folders like I hope you would reconsider this. It doesn't have to be I will also note that if there was some existing way to accomplish the requirement of installing packages automatically and I asked for an alternative way, that original way could be considered as a resolution By Design. In this case, there is no way to install packages automatically, so the resolution is more like Won't Fix. |
@nkolev92 how is this closed as 'completed' ? There is no fix at all, this is a huge problem for cmake users using the Nuget package system. |
NuGet Product(s) Involved
NuGet.exe
The Elevator Pitch
nuget.exe
is missing a chunk of package management functionality in that can download and unpack packages withnuget install
, but it won't modify C/C++ project files, which makes it impossible to automate adding packages to generated projects, such as those generated by CMake.Please provide a way to invoke
nuget install
in a way that can update.vcxproj
files to propagate.props
and.targets
from packages into project files, including per-project configurations, such aspackages.<project-name>.config
.Additional Context and Details
One use of this is to allow installing Nuget dependencies for CMake-generated projects, which lack support for C/C++ Nuget packages. With this feature, it would be possible to run these commands to resolve all project dependencies:
Being able to modify project files also will provide a more complete solution for package management, which now is scattered between various Nuget tools and Visual Studio UI.
The text was updated successfully, but these errors were encountered: