Zhang
Zhang

Reputation: 3356

How do I gracefully update boost which have been got via NuGet in Visual Studio?

enter image description here

I get boost library from Manage NuGet Packages in Visual Studio 2019.

enter image description here

There are several versions in the packages folder. I have deleted several, left the latest. However, when I rebuild a project, the old one boost.1.71.0.0 would come up again.

I tried to modify MyProject\packages.config and MyProject\MyProject.vcxproj files. Replaced all boost.1.71 with boost.1.77,

enter image description here

enter image description here

It still doesn't work. boost.1.71.0.0 persist coming up.

Upvotes: 0

Views: 209

Answers (2)

Yujian Yao - MSFT
Yujian Yao - MSFT

Reputation: 954

You could also try this method.The problem is caused by the cache, you need to clear the cache. Before that, you need to make a backup of the folder where the nuget package is stored in the project folder and delete it (if it exists). I suggest you try Tools> NuGet Package Manager> Package Manager Settings> click Clear All NuGet Cache(s), then restore packages (right click solution node> Restore NuGet Packages). And I suggest you read this document carefully and run dotnet nuget locals all --clear or nuget locals all -clear to clear the nuget cache completely. enter image description here enter image description here

Upvotes: 0

Zhang
Zhang

Reputation: 3356

@zvikan's comment is correct, I succesfully updated my boost version.

enter image description here

Removed package 'boost.1.71.0' from 'packages.config'
Successfully uninstalled 'boost.1.71.0' from MFCTest
Removed package 'boost_date_time-vc142.1.71.0' from 'packages.config'
Successfully uninstalled 'boost_date_time-vc142.1.71.0' from MFCTest

enter image description here

boost.1.71 disappeared automatically in the packages folder.

Upvotes: 1

Related Questions