Steps for a clean installation of a NuGet package from a local source
23 Jun 20261 minute to read
To perform a clean installation of a NuGet package from a local source, follow these steps:
- Save the .nupkg file
Save the NuGet package file (.nupkg) to a local directory, such as: C:\MyNuGetPackages
- Configure the local package source in Visual Studio
-
Open Visual Studio
-
Navigate to: Tools > Options > NuGet Package Manager > Package Sources
-
Add a new package source and point it to the folder from Step 1
- Uninstall the existing package
If the package is already installed in your project, uninstall it to avoid conflicts.
- Clear the NuGet cache
Run the following command in a terminal or command prompt to clear cached packages:
dotnet nuget locals all --clear
- Reinstall the package from the local source
Use the NuGet Package Manager or CLI to install the package from the newly added local source.