vb.netnuget-packagetarget-framework

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'


Solution

  • 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:

    How:

    enter image description here

    enter image description here

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