0

I've got an ASP.NET Web Application (in the formal sense, it's not a "Web Site" project). It references some number of NuGet packages (let's call them all v1.0).

If I edit packages.config to reference a newer version of one of the NuGet packages and build, restore packages, or attempt to update the packages everything seems fine. It downloads the new package, creates a folder for it and the whole deal.

The problem comes when I attempt to reference newly added classes or properties within that package. (Let's call it v2.0.)

IntelliSense doesn't know about them. When I start trying to figure out why, I find that it's still referencing v1.0. It has downloaded 2.0, and the package file asks that it should use 2.0, but unless I explicitly remove the reference to the package and re-add it, VisualStudio seems content to stick with v1.0.

I feel like I must be doing something wrong, or at some point in time something has been configured incorrectly, but I'm at a loss as to what that might be.

Any advice?

Anthony Compton
  • 5,271
  • 3
  • 29
  • 38

1 Answers1

0

You shouldn't update packages.config to get new package versions. Package Restore simply downloads the package files. It doesn't update references, etc.

To update a package you can use the Manage NuGet Packages dialog to install updates or use the Package Manager Console and type: Update-Package

Kiliman
  • 18,460
  • 3
  • 39
  • 38
  • What if the current version in use is 1.0, the latest version is 3.0, and the version I need (for whatever reason) is 2.0. How do I specifically update to 2.0? – Anthony Compton Feb 28 '14 at 15:55
  • `Update-Package My.Package.Id -Version 2.0` (where My.Package.Id is the package you're updating). BTW: If you add `-Safe`, `Update-Package` will only update to same Major.Minor version. So 1.1.0 to 1.1.1 not 1.2.0. – Kiliman Feb 28 '14 at 17:53