Nuget行为nocache和清除 [英] Nuget Behavior nocache and clear

查看:195
本文介绍了Nuget行为nocache和清除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用clear语句< / clear>创建了特定于解决方案的nuget.config文件。并引用与默认nuget.config文件不同的Source。


有时,解决方案特定的源存储库将在解决方案还原期间显示带有提取的日志。但更频繁的是,没有从解决方案特定或默认的源存储库中提取源的日志。


我是否假设正在从缓存中提取包?


我们不使用默认的源存储库,因为这些对象是手动添加的,而不是从Nuget Gallery中提取的。特定于解决方案的nuget.config文件中指定的源存储库直接从Nuget Gallery中提取工件。当两个存储库之间存在差异时,
会发生什么?我担心缓存中可能存在一个对象版本,该版本已经从Nuget Gallery中的原始版本进行了修改。


我想在我的restore语句中添加-nocache以保证缓存没有被使用,但遗憾的是从TFS XAML构建中调用了restore语句,我不确定如何将此选项添加到restore命令。我知道使用
TFS 2015 vNext构建这是可能的,但在成功迁移我们的XAML构建之前,我无法使用此功能。


非常感谢任何帮助!

解决方案

您好,


感谢您在此发帖。


请参阅
本文档
NuGet管理多个本地缓存,以避免下载计算机上已有的软件包,并提供离线支持。 


对于XAML构建,您需要自定义构建过程模板,添加批处理文件以运行
nuget locals all -clear 构建之前的命令。


祝你好运,


A solution specific nuget.config file has been created with a clear statement </clear> and references a Source different from the default nuget.config file.

Sometimes the solution specific source repository will show a log with pulls during the solution restore. But more frequently there is no log of sources being pulled from the solution specific or default source repository.

Am I to assume the package is being pulled from cache?

We do not use the default source repository because the objects are manually added and not pulled from the Nuget Gallery. The source repository specified in the solution specific nuget.config file pulls artifacts directly from the Nuget Gallery. What happens when there is a discrepancy between the 2 repositories? I am concerned that an object version may exist in cache that has been modified from it's original version in the Nuget Gallery.

I would like to add -nocache to my restore statement to guarantee that cache is not being used, but unfortunately the restore statement is being called from within TFS XAML builds and I am unsure how to add this option to the restore command. I know with TFS 2015 vNext build this is possible, but I am not able to use this feature until a successful migration of our XAML builds.

Any help is greatly appreciated!

解决方案

Hi,

Thank you for posting here.

Refer to this document: NuGet manages several local caches to avoid downloading packages that are already on the machine, and to provide offline support. 

For XAML build, you need to customize the build process template, add batch file to run nuget locals all -clear  command before build.

Best regards,


这篇关于Nuget行为nocache和清除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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