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. Oracle 数存储——物理结构

    Oracle存储——逻辑结构 Oracle 数据库存储物理结构 物理存储结构是实际的数据存储单元,对应于操作系统文件. oracle数据库就是由驻留在服务器的磁盘上的这些操作系统文件组成的. 物理存储 ...

  2. Spring Data之Hello World

    1. 概述 SpringData : 注意目标是使数据库的访问变得方便快捷;支持NoSQL和关系数据存储; 支持NoSQL存储: MongoDB(文档数据库) Neo4j(图形数据库) Redis(键 ...

  3. var 声明变量的变量提升问题(let/const)

    在ES6之前,JavaScript没有块级作用域(一对花括号{}即为一个块级作用域),只有全局作用域和函数作用域.变量提升即将变量声明提升到它所在作用域的最开始的部分.既全局变量. <scrip ...

  4. 从数学分析的角度来看Softmax

    作者:无影随想 时间:2016年1月. 出处:https://zhaokv.com/machine_learning/2016/01/softmax-calculous-perspective.htm ...

  5. sipp模拟freepbx分机测试(SIP协议调试)

    1.sipp的安装 1) 在centos 7.2下安装 yum install make gcc gcc-c++ ncurses ncurses.x86_64 ncurses-devel ncurse ...

  6. 使用Robomongo连接数据库不成功:没有启动MongoDB

    启动MongoDB ➜ ~ mongod --07T16:: I CONTROL [initandlisten] MongoDB starting : pid= port= dbpath=/data/ ...

  7. nginx映射文件服务器文件夹

    nginx映射文件服务器文件夹 普通用户A安装的nginx,yum源搭建文件服务器,新建普通用户B,其主目录是文件服务器需要访问的目录 普通用户A启动nginx无法访问B用户的文件服务器目录,提示40 ...

  8. jQuery对象和DOM对象之间的转换

    jQuery对象不能使用DOM对象的任何方法,DOM对象也不能使用jQuery对象的任何方法.在需要使用时需要对其进行转换. jQuery对象前使用"$",这不是必须的,不这么使用 ...

  9. MVC[xml]页面传值

    MVC 各种传值方式 ViewData传值.HomeController.cs Co de: public ActionResult Index(){      ViewData["Titl ...

  10. Spring-1-H Number Sequence(HDU 5014)解题报告及测试数据

    Number Sequence Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u Pro ...