将nuget软件包的更新限制为某些软件包的当前版本 [英] Restrict nuget package updates to current versions for some packages

查看:116
本文介绍了将nuget软件包的更新限制为某些软件包的当前版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以禁用项目中安装的特定nuget软件包的更新?

Is there a way to disable updates of specific nuget packages installed in a project?

我已经对几个javascript库软件包进行了一些本地修改,并且不想冒着将来有人在我的更改之上进行更新的风险.

I have made some local modifications to a couple of javascript library packages and do not want to run the risk of someone updating over the top of my changes in the future.

我从来没有创建自己的nuget包,我猜一个选择可能是分叉现有的包?

I've never created my own nuget package, I'm guessing one option might be to fork the existing packages?

推荐答案

您可以尝试约束包,因此您的项目将只允许使用特定版本.然后,将阻止所有对任何较新版本的更新.

You could try constraining the package so it your project will only allow a particular version to be used. Then all updates to any newer version will be prevented.

您可以通过编辑项目的package.config文件来实现.例如,下面的行应仅允许使用版本2.1.0.

You can do this by editing your project's package.config file. For example, the line below should only allow version 2.1.0 to be used.

<package id="SomePackage" version="2.1.0" allowedVersions="[2.1.0]" />

这篇关于将nuget软件包的更新限制为某些软件包的当前版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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