NuGet / Home

Repo for NuGet Client issues
Other
1.5k stars 252 forks source link

Support nuget for c++ with CMake projects #6731

Open prassanna-ravishankar opened 6 years ago

prassanna-ravishankar commented 6 years ago

Details about Problem

NuGet product used : Package Manager Console on VS2017

NuGet version (x.x.x.xxx): 4.6.0

dotnet.exe --version (if appropriate): -

VS version (if appropriate): 2017 (professional + community)

OS version (i.e. win10 v1607 (14393.321)): win10 v1709

Worked before? If so, with which NuGet version: No

Detailed repro steps so we can see the same problem

  1. Open/create a cmake project with visual studio

  2. Try on the package manager console : Install-Package boost -Version 1.66.0

Other suggested things

Verbose Logs

Install-Package boost -Version 1.66.0

Install-Package : Project 'Default' is not found.
At line:1 char:1
+ Install-Package boost -Version 1.66.0
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ObjectNotFound: (Default:String) [Install-Package], ItemNotFoundException
+ FullyQualifiedErrorId : NuGetProjectNotFound,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

>> works with a visual c++ studio style project/solution

johanlindfors commented 5 years ago

This is becoming very important! I have similar issues with Microsoft.Windows.CppWinRT which cannot be restored to a UWP solution without manual interaction through Visual Studio. This means we cannot leverage CMake to generate our cross-platform solutions and build on build agents such as Azure Pipelines or Jenkins. I would very much see this be prioritized, how can we help?

L4ZZA commented 4 years ago

yes please! and make it a priority!

Big applications that use C#, C++ and C++/CLI are not nicely handled and you have to use separate package managers to do things properly.. don't even think to do those with CMake because PakageReference in c++ are still not a thing (https://developercommunity.visualstudio.com/idea/351636/use-packagereference-in-vcxproj.html) and CMake doesn't even handle package.config files. To summarise, this is a big problem and lack of functionality, that could be solved with this. It would highly appreciated if you'd pushed this forward faster. All old C++ projects that are looking to advance they're build system are slowed down because of this.

rrelyea commented 4 years ago

Have you looked at vcpkg? Does that help your need?

If not, is there something that vcpkg could do to better support this scenario?

@ras0219-msft

L4ZZA commented 4 years ago

Supporting two different system (Nuget and Vcpkg) comes with maintenance cost and we'd rather avoid that as we're already short-staffed. Since NuGet is the go to for C# projects and our product is made of C#, CLI, and C++ we see more reasonable to use only one package manager for all. @rrelyea