Reinstall NuGet packages after upgrading a project

We all have had projects which have been running for quite sometime. However, when we open them after a few months, we find many upgrades that can be performed.

Well, this happened to me this week and I found that my project which has been running for almost 5 years now, started off with .Net Framework 4.5. At present, it was still targeted to .Net Framework 4.5.2. So I decided to upgrade the runtime version to .Net Framework 4.7.2. Although this is good then I started seeing some warnings.

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:

To be honest, we programmers always tend to ignore the warnings and focus more on errors. However, this is not the one that one should ignore especially if this is a library that will have to be referenced somewhere.

How to fix this?

The easiest way to do this is by executing this command in Package Manager Console

Update-Package -Reinstall -ProjectName Project.Name.Here

In the above command, we can see a parameter -Reinstall. It instructs the NuGet Package Manager to remove the NuGet packages and reinstall the same versions. This gives NuGet a chance to determine which assembly is most appropriate for the current framework targeted by the project.

To conclude, it was really easy to get rid of this warning as it can occur whenever a project is upgraded to a different target framework.

Happy Coding!

NuGet Packages for Xamarin

Well, since I have been working on lots of Xamarin stuffs, I thought it’s sometimes best to list down the NuGet packages that are really amazing and helps you create the boiler plate of your App in a much easier and faster way.

The NuGet Packages

Let’s look at the worthy NuGet packages which are worth looking into.

NameDescriptionPlatforms
Acr.UserDialogsA cross platform library that allows you to call for standard user dialogs from a shared/portable libraryXamarin.Android Xamarin.iOS UWP Xamarin.Forms
SQLiteNetExtensionsSQLite-Net Extensions is a very simple ORM that provides cascade operations, one-to-one, one-to-many, many-to-one, many-to-many, inverse and text-blobbed relationships on top of the sqlite-net library.Xamarin.Forms
Rg.Plugins.PopupPlugin for Xamarin Forms. Allows you to open any page as a popup. Xamarin.Forms
Xamarin.Forms.DebugRainbows Adds a very colorful debug mode to each of your ContentPages that lets you immediately see where all of your elements are located. Xamarin.Forms
AkavacheAn asynchronous, persistent key-value store for desktop and mobile applications on .NETXamarin.Forms

I will keep updating this list as I keep encountering on these stuffs. Feel free to let me know if there are some I have missed.

Happy Coding!