Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to update NuGet package

Working with VS2015 I recently updated an add-on I use, ActiveReports, to a new version. Previously I had my application set for netframework 4.0, the new update for ActiveReports required at least netframework 4.5 so I changed the project to use that version.

I am getting the following error now when I build the project:

"Some NuGet packages were installed using a target framework different from the current target framework and may need to be reinstalled. Visit http://docs.nuget.org/docs/workflows/reinstalling-packages for more information. Packages affected: Microsoft.Bcl, Microsoft.Net.Http"

I have been looking at the various options suggested to address this none have worked. The last one I tried from Tools> NuGet Package Manager > Package Manager Console resulted in the following message:

PM> Update-Package Attempting to gather dependency information for multiple packages with respect to project 'My Project', targeting '.NETFramework,Version=v4.5' Attempting to resolve dependencies for multiple packages. Resolving actions install multiple packages Resolution was successful but resulted in no action There are no new updates available. No package updates are available from the current package source for project 'My Project'

like image 243
Terabithia Avatar asked Nov 27 '25 11:11

Terabithia


1 Answers

I can reproduce this by:

  1. creating a new project as .NET 3.5, installing NuGet package Newtonsoft.Json" (just for example).
  2. Changing my project to .NET 4.5

Then I receive an error:

Severity Code Description Project File Line Suppression State Error Some NuGet packages were installed using a target framework different from the current target framework and may need to be reinstalled. Visit http://docs.nuget.org/docs/workflows/reinstalling-packages for more information. Packages affected: Newtonsoft.Json ConsoleApp7 0

To resolve:

  • Uninstall the existing NuGet packages (for that project), and reinstall them:

How:

  • Right-click your Solution:

enter image description here

  • Choose "Manage NuGet Packages for Solution..."
  • Navigate to the "Project" you changed to .NET 4.5
  • Choose "Uninstall", then try to reinstall them, using the same steps.

enter image description here

After re-installation of the package is complete, the build error is gone.

like image 164
Brien Foss Avatar answered Nov 29 '25 17:11

Brien Foss



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!