Installed nuget packages in Visual Studio 2019 project checkbox unchecked - visual-studio

I am trying to create a packages file for the project & noticed that installed nuget packages in Visual Studio 2019 have got the project box unchecked.
I am positive that I am using these packages in the project.
For instance I am using the Entity Framework for the data access & update. I have ensured that all the packages are still being used in the project & the packages.config file has got all the packages listed in it.
Visual Studio ScreenShot

Installed nuget packages in Visual Studio 2019 project checkbox
unchecked
The window which you provided actually does not actually work as you described. And it is just designed by that.
What you need to note is that the projects that can be displayed on this window, such as 2020Portal.Data, 2020Portal.Mailbox, etc., have already installed the nuget package Entity Framework. Only projects that already have the nuget package installed can be displayed in this window. That's why they show up there.
And the checkbox functionality is only intended to enable the selected items to perform uninstall or update the nuget Entity Framework. It's just for the convenience of choosing certain operations to perform.
Hope it could help you.

Related

Reference hell accessing .netstandard with framework VS2019 preview

I can get my .net standard 2.0 package working in a .net framework 4.7.2 dll if I do the following steps
In my standard project VS2019 61.4.4 right click the project and select pack to create the .nupkg
Then I set up a nuget package source for the package
In my framework project I install nuget package
I get the following dialog
I choose PackageReference in project file
I answer yes to accept licensing
Then I can see the following
And I can get my project working.
However on a different machine running VS2019 16.5.0 Preview 2.0, I do not get the dialog asking me to choose the package manager format.
Instead the references look like
and I can not get my project working.
[Update]
After following Lance's link to migrate packages.config to PackageReference
The project looks like
I was able to remove the unwanted packages by right clicking references and choosing Remove Unused References
The program worked!
Go Tools=>Nuget Package Manager =>General => Package Management You can control the behavior by Allow format selection on first package install. Enable the checkbox and restart VS, this change will take effect.
And note the dialog only appears when we install first package in current project. So if you create a new project and install package, it will appear. And since you once installed packages in that project, the dialog won't appear in WindowsFormApp2 any more.
(But you can easily migrate packages.config to PackageReference, see this).

Getting alert of telerik ui for asp.net mvc requires nuget package manager 2.8 or later

For Visual studio 2013, when I try to create a new project, I get this alert message "Telerik UI for ASP.Net requires NuGet Package Manager 2.8.50126.400 or later".
I am not understanding what it is trying to say and unable to create my project and start my work.
In the menu bar in Visual Studio, I have one menu option named "TELERIK", may be it is related to that but not getting the exact solution to this. Please suggest.
You need to update the NuGet package manager that is installed inside your Visual Studio. You can download the latest version for VS 2013 from here https://marketplace.visualstudio.com/items?itemName=NuGetTeam.NuGetPackageManagerforVisualStudio2013 or you can go Tools > Extensions and Updates and update it from there.

TFS solution is downloaded along with the Nuget Packages but the references are missing?

I'm training 5 people on using Visual Studio. They've mapped their drives and have "downloaded" the solution from TFS which contains 10 projects. All located at the same depth in TFS folder structure. When the new folks download the solution there's one project that doesn't get the NUGET references even though the Package folder (created by NUGET) is at the same depth of the other 10 projects when viewed in TFS.
We know how to add these manually but is there a way to automatically have VS do it? Why would only one project lose it's reference with the Package Folder right there?
It seems you are still using MSBuild-Integrated package restore approach. If NuGet recognizes that the MSBuild-Integrated package restore approach is enabled for the solution, Automatic Package Restore is skipped.
You need to migrating MSBuild-Integrated solutions to use Automatic Package Restore, then the packages will be restored automatically.
In addition, you need to update you NuGet manager to the latest version in VS Tools--Extensions and Updates. And make sure Visual Studio is configured to 'Allow NuGet to download missing packages' and 'Automatically check for missing packages during build in Visual Studio' in VS Tools--Options--NuGet Package Mnager--General.
To Fix:
Unload all projects first, then right click and select edit project.
Find this line:
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
Comment it out.
Reload all the projects and compile.
This applies to Nuget api version 2.
Note you may configure all projects for Nuget at the solution level.
The package manager for the solution presents a set of check boxes for every project along with the buttons (Install or Uninstall).

Visual Studio + nuget + TFS: checking in nuget packages?

I'm working on a TFS project with a small team. This project has a bunch of nuget packages installed, but it's for a 4.0 project, and the nuget package manager GUI doesn't even offer the older versions of the packages any longer since their 4.5 equivalents are now being used. In order to allow other team members to compile the project, they need to have the exact versions of the packages. I'd like to check in the entire "packages" folder used by nuget. Is this a good idea? If so, how does one check in the "packages" folder and all its contents since it exists at the solution level? There is no "Include in Solution" option in Visual Studio as there is when you right-click an assembly.
in the past I have also checked in the NuGet packages into version control. With this some problems appeared:
Some packages where not checked into version control when committing from Visual Studio into TFS.
Updating packages became a real problem.
For the first problem I had used the TFS Power Tools. The problem with this solution is that every developer needed to install the Power Tools.
A better solution came up with NuGet 2.7. It introduced package restore. With package restore there's no need to check-in the packages folder. They will be restored during build.
We use an on-prem TFS install with no internet access so we have to check in our package folders or our builds fail. The biggest issue is that VS does not behave consistently when it comes to adding the pending changes for new package files, often times it will ignore the .dll files in the pending changes window, sometimes it adds everything fine.

Visual Studio wants to check in NuGet packages despite disabling source control integration

Any idea why Visual Studio wants to add the packages folder to source control despite having disableSourceControlIntegration set to True in .nuget\NuGet.Config?
It was working properly. Then I added a new project and to that project added a reference to Entity Framework via NuGet, making two projects in the solution that use EF. This seems to have confused Visual Studio and now the packages folder shows up in the changelist whenever I check in changes.

Resources