简体   繁体   English

如何重定向.nuget文件夹? 和nuget包与SDK nuget包的区别

[英]How to redirect .nuget folder? and Difference between nuget package and SDK nuget Package

I'm suffering from changing default .nuget packages directory. 我正在更改默认的.nuget软件包目录。
I want to change default nuget folder because It seems grow bigger and bigger. 我想更改默认的nuget文件夹,因为它看起来越来越大。 and It now occupies 5.0 GB in my OS main Drive C. 现在它在我的操作系统主驱动器C中占用5.0 GB。
so, I cut and copied .nuget folder from users\\nuget to secondary Hard Drive D. 因此,我将.nuget文件夹从users \\ nuget剪切并复制到辅助硬盘D。

在此处输入图片说明

and then, I think that I did redirect it with solution package management. 然后,我认为我确实通过解决方案包管理对其进行了重定向。
below is picture of it. 下面是它的图片。

在此处输入图片说明

and below is .xml source of Nuget.Config file in my %AppData%Nuget 下面是我的%AppData%Nuget中Nuget.Config文件的.xml源

<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="Package source" value="D:\.nuget\packages" />
    <add key="Microsoft Visual Studio Offline Packages" value="C:\Program Files (x86)\Microsoft SDKs\NuGetPackages\" />
  </packageSources>
  <config>
    <add key="repositoryPath" value="D:\.nuget\packages" />
  </config>
  <packageRestore>
    <add key="enabled" value="True" />
    <add key="automatic" value="True" />
  </packageRestore>
  <bindingRedirects>
    <add key="skip" value="False" />
  </bindingRedirects>
  <packageManagement>
    <add key="format" value="0" />
    <add key="disabled" value="False" />
  </packageManagement>
  <disabledPackageSources>
    <add key="Microsoft Visual Studio Offline Packages" value="true" />
  </disabledPackageSources>
</configuration>

the problem is, when I compiled my UWP Project - just blank UWP. 问题是,当我编译UWP项目时-只是空白的UWP。
then It starts to download something. 然后它开始下载一些东西。 I don't Know how to Stops to download nuget packages. 我不知道如何停止下载nuget软件包。
It appeared again with Users\\Nuget 3.0 GB. 在Users \\ Nuget 3.0 GB中再次出现。
在此处输入图片说明

How can I stops downloading nuget in C drive user\\nuget? 如何停止在C驱动器用户\\ nuget中下载nuget? and can I set my Visual Studio so that It should find or download nuget packages from or to specific folder? 是否可以设置Visual Studio,使其从特定文件夹中查找或下载nuget包?

and Also I don't understand difference between user\\nuget and ProgramFiles\\Microsoft SDK\\NugetPackages. 而且我也不理解user \\ nuget和ProgramFiles \\ Microsoft SDK \\ NugetPackages之间的区别。 below is picture of them. 下面是它们的图片。

在此处输入图片说明

can you explain me what is the difference between user\\nuget and Programfiles...nugetpacakges..? 您能解释一下user \\ nuget和Programfiles ... nugetpacakges ..有什么区别吗?

Thanks for reading. 谢谢阅读。

This is the global packages folder, not repositoryPath . 这是全局包文件夹,而不是repositoryPath You can configure it via the globalPackagesFolder config property: 您可以通过globalPackagesFolder config属性globalPackagesFolder配置:

<config>
    <add key="globalPackagesFolder" value="D:\.nuget\packages" />
</config>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM