简体   繁体   English

TFS 2017-Nuget提要-恢复之前的延迟采用最新的软件包版本

[英]TFS 2017 - Nuget feed - Delay before restore take last package version

I'm using TFS 2017, with a nuget feed. 我正在使用带有nuget提要的TFS 2017。

After I published a new (non pre-release) version of my package in the feed, let's say My.Package Version 1.0.1 , I need to wait about 30 minutes before restoring the project that references the published package. 在Feed中发布软件包的新版本(非预发行版)后,假设My.Package Version 1.0.1 ,我需要等待大约30分钟才能恢复引用已发布软件包的项目。

Otherwise, and even if I see the version 1.0.1 in the TFS Nuget Feed UI, dotnet restore with .net core CLI (and even with --force option) ignores the new version and take the last pre-release version eg My.Package Version 1.0.1-2019041501 否则,即使我在TFS Nuget Feed UI中看到version 1.0.1 ,使用.net核心CLI(甚至使用--force选项)进行dotnet restore也会忽略新版本并采用最新的预发行版本,例如My.Package Version 1.0.1-2019041501

The csproj package reference includes wildcard for pre-release version. csproj软件包参考包括预发行版本的通配符。

<PackageReference Include="My.Package" Version="1.0.1-*" />

Same thing also happens between two pre-release versions but with a delay of 5 minutes only. 在两个预发行版本之间也发生相同的事情,但仅延迟5分钟。 Eg After I published My.Package Version 1.0.1-2019041502 , I need to wait 5 minutes, otherwise restore take My.Package Version 1.0.1-2019041501 . 例如,在发布My.Package Version 1.0.1-2019041502 ,我需要等待5分钟,否则请还原My.Package Version 1.0.1-2019041501

Nuget package project use .Net Standard 2.0.3 and referencing project use .Net Core 2.2. Nuget包项目使用.Net Standard 2.0.3,引用项目使用.Net Core 2.2。

What is the cause of this delay? 延迟的原因是什么?

Thx. 谢谢。

NuGet keeps a HTTP cache it uses to speed up identical queries to HTTP sources, and the cache period is 30 minutes. NuGet保留了一个HTTP缓存,用于加速对HTTP源的相同查询,缓存时间为30分钟。 You can clear it using nuget.exe locals http-cache -clear or dotnet nuget locals http-cache --clear . 您可以使用nuget.exe locals http-cache -clear dotnet nuget locals http-cache --cleardotnet nuget locals http-cache --clear清除它。 I can't explain the 5 minute delay on prerelease packages though. 不过,我无法解释预发布软件包的5分钟延迟。 Is it possible TFS takes 5 minutes to ingest the package after being pushed and make it available in its feed search results? TFS被推送后是否可能需要5分钟来摄取该软件包并将其在其提要搜索结果中可用? I don't believe that NuGet expires its http-cache more quickly when you request prerelease packages, but it sounds feasible. 我不认为当您请求预发行版软件包时,NuGet会使它的http缓存更快地过期,但这听起来是可行的。

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

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