NuGet command in VS : can install package but not

2019-08-30 01:46发布

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.

enter image description here

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条回答
一纸荒年 Trace。
2楼-- · 2019-08-30 01:58

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

查看更多
登录 后发表回答