DEV Community

Kenichiro Nakamura
Kenichiro Nakamura

Posted on

3 2

NuGet Developer Tips: Refer local nupkg and delete cache

When we develop NuGet package in local environment, there are several things we need to be careful.

NuGet package source

In Visual Studio or NuGet cli, we can specify source where to find the package. When developing NuGet package, we can use local folder path as NuGet source.

nuget source

By doing this, we can omit uploading package to feed or NuGet.org for test.

NuGet package version

Whenever we update something, we need to give different version for nupkg file, so that NuGet manager can download new package. If we use same version number, then NuGet manager keep using local cache which downloaded previously.

Delete local NuGet pack

We sometimes need to delete local NuGet pack to avoid conflict between local cache versus package in feed. We can find the cache path by running NuGet command.

nuget locals all -list
Enter fullscreen mode Exit fullscreen mode

For Windows, I find it in my profile.

%UserProfile%\.nuget\packages

nuget cache

Just delete the specific package folder. Even though we can use NuGet cli to delete cache for source level, I won't recommend clear entire cache as we have to download all dependencies again when we restore or compile next time. Please teach me if NuGet cli has command to delete specific cache.

Image of Docusign

Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay