开发者

Why doesn't Installed packages show the package I just installed?

开发者 https://www.devze.com 2023-03-09 15:27 出处:网络
I\'ve been getting started with Nuget. Some of my projects allow me to Add Library Package Reference to a Nuget package, but then when I select\"Installed Packages\" I don\'t see any packages listed.

I've been getting started with Nuget. Some of my projects allow me to Add Library Package Reference to a Nuget package, but then when I select "Installed Packages" I don't see any packages listed. Why not?

EDIT - I know the answer (see below), was going to answer this myself as a "community service" but can't for another 8hrs due to my lame rep score.

Answer will be: The project already had a packages.config file in the same directory as the csproj file, BUT the packages.config file was not added to the project. Fixed by "Add existing item" and selecting the packages.config file.

Note: in hindsight, the pink '"packages.config" already exists, Skipping' message in the nuget progr开发者_开发技巧ess window should have alerted me to this.

Hope this helps someone.


(Pasted from the question, so this doesn't show up as unanswered)

The project already had a packages.config file in the same directory as the csproj file, BUT the packages.config file was not added to the project. Fixed by "Add existing item" and selecting the packages.config file.

Note: in hindsight, the pink '"packages.config" already exists, Skipping' message in the nuget progress window should have alerted me to this.


In another case, the packages.config file is part of the project, but the definition of the <packages> tag was like <packages xmlns="urn:packages"> rather than the usual <packages> convention. This caused my project to neither restore nor show up any packages. This is confirmed in Visual Studio 2015. Once i remove "urn:packages" all started to work fine.


I had a project that was originally targeting .Net Framework 4, using Entity Framework 5. I updated the .Net Framework to 4.5, and I tried to remove the NuGet package for EF5. That ended up leaving the Packages folder in the project folder, but the packages.config file was listed in the project as missing.

I deleted the Packages folder and was then able to successfully add the EF6 NuGet package.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号