![Forrest logo](/images/logo.png)
dotnet-restore:tldr:78ae2
The command dotnet restore --no-cache
is used to restore the dependencies of a .NET project without using any cached packages.
In a .NET project, the dependencies are defined in a file called project.json
(for older .NET Core versions) or *.csproj
file (for newer .NET Core versions). These dependencies can be packages from NuGet, which are downloaded and stored locally in a cache to avoid downloading them every time a restore is performed.
However, sometimes you may want to bypass the cache and force a fresh download of all dependencies. This is where the --no-cache
option comes in.
When you run the command dotnet restore --no-cache
, it will initiate the restore process for your project's dependencies, but it will not use any cached packages. Instead, it will download the required packages directly from the NuGet repository, ensuring that you get the latest versions.
This can be useful in scenarios where you suspect that the cached packages are causing issues, or if you want to verify that your project can successfully restore dependencies without relying on the cache.