https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore#forcing-restore-from-package-sources

By default, NuGet restore operations use packages from the global-packages and http-cache folders, which are described on Managing the global packages and cache folders.

To avoid using the global-packages folder, do one of the following:

  • Clear the folder using nuget locals global-packages -clear or dotnet nuget locals global-packages --clear
  • Temporarily change the location of the global-packages folder before the restore operation using one of the following methods:
    • Set the NUGET_PACKAGES environment variable to a different folder.
    • Create a NuGet.Config file that sets globalPackagesFolder (if using PackageReference) or repositoryPath (if using packages.config) to a different folder (see configuration settings
    • MSBuild only: specify a different folder with the RestorePackagesPath property.

To avoid using the cache for HTTP sources, do one of the following:

  • Use the -NoCache option with nuget restore or the --no-cache option with dotnet restore. These options do not affect restore operations through the Visual Studio Package Manager UI or Console.
  • Clear the cache using nuget locals http-cache -clear or dotnet nuget locals http-cache --clear.
  • Temporarily set of the NUGET_HTTP_CACHE_PATH environment variable to a different folder.

执行这2个命令

nuget locals global-packages -clear

Use the -NoCache option with nuget restore

Example

nuget sources add -Name "rdc" -Source http://172.31.212.138:8089/Nuget
nuget locals global-packages -clear
nuget restore LISA.CMSWeb.sln -NoCache
pause

Forcing restore from package sources的更多相关文章

  1. .net core 2.0 报错:error NU1102: Unable to find package 。。。

    这种是nuget无法还原的问题.解决问题的方法: 在项目文件所在的目录下创建文件:NuGet.Config 里面内容: "?> <configuration> <pa ...

  2. .net core 2.0 报错:error NU1102: Unable to find package ...

    原文地址:传送门 这种是nuget无法还原的问题.解决问题的方法: 在项目文件所在的目录下创建文件:NuGet.Config 里面内容: <?xml version="1.0" ...

  3. 你需要知道的包管理器(Package Manager)

    最近我花了一点时间关注了在不同系统之中所用到的包管理器(Package Manager) .最开始的时候,我是在使用Linux操作系统时,对这种工具以及它背后的想法深深迷恋住了:这真是自由的软件世界. ...

  4. windows系统下的第一个console程序

    窗口+r 键,输入cmd,打开一个命令行窗口 切换到你的目标目录 输入 dotnet new dotnet会自动帮你创建3个文件. NuGet.Config文件主要定义了NuGet获取nupkg包时的 ...

  5. Cloudinsight Agent install script

    #!/bin/bash # Cloudinsight Agent install script. set -e logfile="ci-agent-install.log" gis ...

  6. NET Core 1.0 RC2

    NET Core 1.0 RC2 历险之旅 文章背景:对于.NET Core大家应该并不陌生, 从它被 宣布 到现在已经有1-2年的时间了,其比较重要的一个版本1.0 RC2 也即将发布..Net C ...

  7. .netcore入门

    开发环境:windows    编辑器: Visual Studio Code 环境安装: .Net Core 1.1 SDK     https://www.microsoft.com/net/co ...

  8. 06 Frequently Asked Questions (FAQ) 常见问题解答 (常见问题)

    Frequently Asked Questions (FAQ) Origins 起源 What is the purpose of the project? What is the history ...

  9. 在VS中自动生成NuGet包以及搭建自己的或单位内部的NuGet服务器

    关于NuGet的介绍已经很多,可以参考下面的: NuGet学习笔记(1)--初识NuGet及快速安装使用 http://kb.cnblogs.com/page/143190/ NuGet学习笔记(2) ...

随机推荐

  1. URI 、URL 和 URN

    URI URI 是 Uniform Resource Identifier 的缩写. Uniform 统一不同类型的资源.比如 txt.mp3.jpeg 等不同的类型的资源都可以使用 URI 来标识 ...

  2. node jar sh

    https://nodejs.org/api/child_process.html Node.js v11.1.0 Documentation Index View on single page Vi ...

  3. 【opencv】ubuntu opencv imshow()报错

    错误提示: ubuntu opencv imshow() 报错 windows.cpp报错 the function is not implemented If you are on Ubuntu o ...

  4. python爬虫系列(2)—— requests和BeautifulSoup

    本文主要介绍python爬虫的两大利器:requests和BeautifulSoup库的基本用法. 1. 安装requests和BeautifulSoup库 可以通过3种方式安装: easy_inst ...

  5. python 添加进度条

    安装: pip install tqdm使用: from tqdm import tqdm import time for i in tqdm(rang(10)): time.sleep(0.1)

  6. 【市场调研与分析】Intel发力移动安全领域——By Me at 20140613

                                                    [市场调研与分析]Intel发力移动安全领域                               ...

  7. IIS7 Microsoft.Web.Administration 创建Application问题

    在使用DirectoryEntry操作IIS时,可以设置很多属性.但使用Microsoft.Web.Administration中的一些类时,不知道在哪设置.例如:AccessScript,Acces ...

  8. 003-maven简介

    1.1简介 Maven,只是的积累,专家或内行 Maven是优秀的构建工具,依赖管理工具,项目信息管理工具,跨平台.提供了中央仓库,自动下载构件. 1.通过坐标系统定位每一个构件(artifact), ...

  9. Sails 框架学习资料

    一介布衣 http://yijiebuyi.com/so.html?k=sails sails modules 模型自带的方法介绍 2016-09-06  929  nodejs查看更多 node.j ...

  10. python学习笔记(二十四)继承与封装

    继承(extends)就是把多个类中相同的成员给提取出来定义到一个独立的类中,然后让这多个类和该独立的类产生一个关系,这多个类就具备了这些类容,这个关系就叫做继承. 实现继承的类称为子类,也叫派生类, ...