我以前从未在Visual C++项目中使用过nuget。但现在我得到了帮助
How to use the C Rest SDK NuGet package
there
我已经启动了c++控制台项目,点击
"Manage NuGetPackages for solution...
并得到了包裹清单。看起来所有项目都适用于.NET。
如果我键入
cpprestsdk
我可以在Visual C++项目中使用NuGet吗?为什么缺少列表。如何安装cpp REST SDK?
UPD:
是的,这是错的C项目,但与C++项目的图片是一样的。
Type 'get-help NuGet' to see all available NuGet commands.
PM> Install-Package cpprestsdk -Version 2.9.1.1
Attempting to gather dependency information for package 'cpprestsdk.2.9.1.1' with respect to project 'ConsoleApplication1', targeting 'native,Version=v0.0'
Install-Package : Package 'cpprestsdk,2.9.1.1' is not found in the following primary source(s): 'C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\'. Please verify all your online package sources are available (OR) package id, version are specified correctly.
At line:1 char:1
+ Install-Package cpprestsdk -Version 2.9.1.1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
PM> Install-Package cpprestsdk
Install-Package : Unable to find package 'cpprestsdk'
At line:1 char:1
+ Install-Package cpprestsdk
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
PM>
可能是NuGet来源有问题:
以下是我搜索包的方式: