如何使用命令行清除 NuGet 包缓存? [英] How can I clear the NuGet package cache using the command line?

查看:92
本文介绍了如何使用命令行清除 NuGet 包缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用 Visual Studio 菜单工具清除我的开发计算机的 NuGet 包缓存 →选项NuGet 包管理器常规:清除包缓存按钮.

I can clear my development computer's NuGet package cache using Visual Studio menu ToolsOptionsNuGet Package ManagerGeneral: Clear Package Cache button.

我想在命令行上执行此操作.不幸的是,我找不到 nuget.exe 的相关命令行开关.

I would like to do this on the command line. Unfortunately, I can not find a related command line switch for nuget.exe.

我错过了什么吗?

推荐答案

首先,从 此处.

接下来,打开命令提示符并cd到下载nuget.exe的目录.

Next, open a command prompt and cd to the directory to which nuget.exe was downloaded.

您可以使用以下命令列出本地缓存:

You can list the local caches with this command:

nuget locals all -list

您可以使用此命令清除所有缓存:

You can clear all caches with this command:

nuget locals all -clear

参考:https://docs.nuget.org/consume/command-line-参考

这篇关于如何使用命令行清除 NuGet 包缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆