NuGet command in VS : can install package but not added to packaged.config & project

a 夏天 提交于 2020-01-07 03:56:11

问题


I am having a problem with a package in a private repository, running install-package "PackageName" just install the package in "packages" folder, but the file packages.config doesn't contain this package, also the project file (*.csproj) is not being updated to have reference to this package.

Normally, it should have a line saying that "Added package to project successfully", but not in this case.

Could anyone please help? Thank you for any idea.


回答1:


An easier way to add reference to a project directly using NPM is described here Best way to add NuGet packages as project references in VS2012?

If that does not help perhaps deleting the package already downloaded and installing it again using the -project switch

PM> Install-Package Glimpse -Version 1.0.0 -Project MvcApplication1

Installs version 1.0.0 of Glimpse into the project named MvcApplication1

To Manually update the package.config in case it is not updated already, use

nuget update <packages.config>

Note : This is a quick work-around. If persistent, this issue must be reported so to be included in Nuget's release notes https://docs.nuget.org/Release-Notes/Known-Issues



来源:https://stackoverflow.com/questions/31801109/nuget-command-in-vs-can-install-package-but-not-added-to-packaged-config-pro

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!