Fix "Unable to Find Package" NuGet Error in Visual Studio C#


👤 Diwas Poudel    🕒 09 Aug 2024    📁 TECH

In this article I will help you fix "unable to find Package" Nuget Error in Visual Studio.

Why "unable to find Package" Error ?

This Error typically occurs when Visual Studio is unable to find Nuget Package in its configured package sources.

Here are the common solutions:

For this follow these steps.

1. Open Visual Studio 

2. On the toolbar Navigate to following path Tools > Nuget Package Manager > Package Manager Settings

   3. On the left pane, expand NuGet Package Manager and then click on Package Sources.

4. In the main Pane search for Nuget 

4 a. If you have Nuget there then make sure you have following 

Name : Nuget

Source : https://api.nuget.org/v3/index.json

Then click on Update button to reflects those name and source.

   

4 b. If you donot have Nuget there then click on Plus icon at the top and then give following name

Name : Nuget

Source : https://api.nuget.org/v3/index.json

Then click on Update button.

   5. Click on Ok button

6. After this just rebuild the solution and your problem will be resolved.

Solution 2: Clear All Nuget Caches

In the same Package Manager Settings Page, Goto General Tab and then click on "Clear All Nuget Storage". Next click on Ok button.

Conclusion: 

These two solutions must fix your Nuget Error.