简体   繁体   English

使用CLI更新.net核心nuget软件包

[英]Update .net core nuget packages with CLI

I'm trying to write a bash script to update a nuget package for a project with the latest version from our Azure package repository. 我正在尝试编写bash脚本,以使用Azure包存储库中的最新版本更新项目的nuget包。

I read somewhere that the CLI way to do this is just to add it again. 我在某处读到,CLI的方法只是再次添加它。

dotnet add myproject.csproj package X20.CQRS.Core

This appears to have worked once, but on subsequent runs I'm just hitting my (presumably) local cache and getting that same version, even though I can see a newer one in the repo. 这似乎已经起作用了一次,但是在随后的运行中,即使我在存储库中看到了更新的版本,我也只是击中了(大概是)本地缓存并获得了相同的版本。

info :   CACHE https://mycompany.pkgs.visualstudio.com/_packaging/4001234e-7178-480f-a784-60c97e0dcfeb/nuget/v3/flat2/aaa.cqrs.core/index.json

Is there a way to avoid the cache hit? 有没有办法避免缓存命中?

Thanks. 谢谢。

A brute-force method of achieving this would be clearing the local cache so that dotnet add package has no choice but go to your repository. 实现此目的的蛮力方法是清除本地缓存,以便dotnet add包别无选择,只能进入您的存储库。 Unfortunately there's no way of just removing one specific package from the cache. 不幸的是,无法从缓存中删除一个特定的程序包。

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

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