Drive C is Full?  Handle it Like a .Net Developer!

Drive C is Full? Handle it Like a .Net Developer!

drive C is always full and it drives me crazy. Whenever I want to install a utility first I need to free up some space ....

Here I found a solution.

about 10 GB of drive C is allocated to folders of nuget package manager (I'm a .net developer so ...). I managed to free up 10 GB just by configuring the nuget.

If you have the same problem, keep reading.

First of all we need to know where nuget is storing its stuff. Run the command below:

 nuget locals all -list

It should output something like this one:

http-cache: C:\Users\web vajhegan\AppData\Local\NuGet\v3-cache
global-packages: C:\Users\web vajhegan\.nuget\packages\
temp: C:\Users\web vajhegan\AppData\Local\Temp\NuGetScratch
plugins-cache: C:\Users\web vajhegan\AppData\Local\NuGet\plugins-cache

So we have 4 folders, and they together occupy about 10 GB of space in my case in C drive. Now we want to to tell nuget to use some other place (somewhere in another drive for example) to do its stuff.

The easiest way is to set some environmental variables in order to override the default configuration.

to change

  • http-catch directory set NUGET_HTTP_CACHE_PATH environment variable
  • global-packages directory set NUGET_PACKAGES environment variable.
  • plugins-cache directory set NUGET_PLUGINS_CACHE_PATH environmental variable.

But the problem with this solution is that it does not work in older versions of nuget.

So make sure your nuget is up to date!


references:

https://docs.microsoft.com/en-us/nuget/consume-packages/managing-the-global-packages-and-cache-folders

https://docs.microsoft.com/en-us/nuget/consume-packages/configuring-nuget-behavior

https://www.mazong1123.com/nuget-config-change-global-package-folder-path/


要查看或添加评论,请登录

Shahryar Saljoughi的更多文章

社区洞察

其他会员也浏览了