4000-520-616
欢迎来到免疫在线!(蚂蚁淘生物旗下平台)  请登录 |  免费注册 |  询价篮
主营:原厂直采,平行进口,授权代理(蚂蚁淘为您服务)
咨询热线电话
4000-520-616
当前位置: 首页 > 新闻动态 >
新闻详情
NuGet tries to install System.Runtime-4.0.20 even though it...
来自 : CSDN技术社区 发布时间:2021-03-24

Here I’m trying to say that if nuget package A depended on ≥System.Runtime-4 AND System.Runtime-4.0.20 to make my .net-4.5 app happy, such a dependency would make it impossible for a .net-4.6 project to install both package A and ≥System.Runtime-4.0.20.

What package were you trying to install originally?

I was installing System.Collections.Immutable-1.1.37 into a .net-4.5 project with dependency resolution set to HighestMinor.

This does not mean that the package cannot be installed into a net45 project, that can only be determined by opening the nupkg and looking for compatible framework folders such as lib\\net45.

Ah, so the “.NETFramework,Version 4.6” I see listed in the nuget extension in VS is a heading for the dependencies required when installing into a .net-4.6 project, not a statement that the project requires .net-4.6. Seems a bit pointless for a project to explicitly declare no dependencies for .net-4.6 if you have to list the archive’s contents to figure out whether or not it provides a lib/net46 or not. So I made a very incorrect assumptions there. And fixing this would take quite a bit more effort than I imagined. I thought that nuget was exposing platforms/frameworks as implicitly-defined virtual packages they could participate in the normal dependency resolution graph—but this is not what is happening and changing that would break the HTTP API for existing clients.

点赞 评论 复制链接分享

私信 访问主页

\"weixin_39902545\" weixin_39902545 2月前

NuGet s preview window shows the result of the dependency resolution phase walks through the package dependencies and verifies that all required packages can be found and that there are no conflicts. An example of a conflict during dependency resolution would be if package A required B 2.0.0, but the project already had package C installed which required B 1.5.0.

The net46 you see in the feed is referring to the dependencies required when the project s target framework is net46 or higher. There is no group for net45 which means that there are zero dependencies for net45. This does not mean that the package cannot be installed into a net45 project, that can only be determined by opening the nupkg and looking for compatible framework folders such as lib\\net45.

The highest minor setting does look like an issue when resolving these packages.

点赞 评论 复制链接分享

私信 访问主页

\"weixin_39542710\" weixin_39542710 2月前

Fair enough, we could do better on this. The assumption is that such breaking changes are not introduced in minor versions ( because it breaks semver). System.runtime breaks this unfortunately.

But I m a bit confused to why you even need it to begin with for a 4.6 app?

Reopening to see if we can do anything about it further. My concern is that trying to find the highest minor that satisfies all dependencies is going to raise the cost and complexity of the resolved to a point that it becomes extremely slow.

In this case if system.runtime followed semver that wouldn t be a problem.

Cc

点赞 评论 复制链接分享

私信 访问主页

\"weixin_39575054\" weixin_39575054 2月前

The resolution phase used by the preview only looks at dependency information from the feed.

It doesn’t even seem to be looking at information in the feed. I can see ::net46 at https://www.nuget.org/api/v2/Packages%28Id %27System.Runtime%27,Version %274.0.20%27%29 .

In my case, I was trying to install a package that depends on ≥System.Runtime-4. I like to set nuget to resolve dependencies to the “highest minor”, though I really don’t know why I would want to be running anything earlier than the latest available release. If the package I’m trying to install just asks for ≥System.Runtime-4, how can I get the system to automatically select the best package version for me automatically? It wouldn’t make sense for everyone to have to have ≥System.Runtime-4 System.Runtime-4.0.20 because they shouldn’t be required to think about which version of System.Runtime suddenly requires a .net framework. Also, putting in such a requirement would break a .net-4.6 app which requires a fix in System.Runtime-4.0.20. Basically, this feels like a time that nuget is not being smart enough about helping users try to install the best versions of available packages.

Anyway, I still am confused that nuget would get beyond the dependency resolution phase before verifying that all dependencies are either existing or able to be installed. The error output just looks wrong. Does this mean that only half of the dependency checks are performed when building the dependency tree and some “fuller” version of dependency checks waits until the package is about to be installed? Why not just do all the checks up front (putting that code in one shared spot) and avoid a rollback? This confusing behavior is what caused me to open this bug. Nuget claimed it could successfully install System.Runtime-4.0.20 even though it had enough information to determine it shouldn’t be able to and relied on rollback behavior instead of just preventing the installation attempt in the first place.

点赞 评论 复制链接分享

私信 访问主页

\"weixin_39542710\" weixin_39542710 2月前

This is a flaw in how these packages where shipped. Minor release changes should not be breaking compatibility. We also do not want the server to keep understanding all versions of target framework logic, because it does not scale to the multitude of private servers out there (where they have to update whenever the nuget logic changes).

These packages will start following semver more strictly going forward and this particular pain point will eventually go away.

As it is we don t plan making any changes in this area at least for now.

If you feel this is the wrong decision, please re-open and provide some more input on why this must be fixed.

点赞 评论 复制链接分享

私信 访问主页

\"weixin_39902545\" weixin_39902545 2月前

The final compatibility check where this is failing requires downloading the nupkg and checking the contents. The resolution phase used by the preview only looks at dependency information from the feed.

点赞 评论 复制链接分享 提交 再想想 采纳 为你推荐 关于无法转换数据类型的问题 c#visual studiomicrosoft 1个回答萌新求助!想用 c# winform(.net)写一个网络监测的小demo 但是为什么使用 using Echevil这个命名空间的时候提示我缺少引用。 c#visual studio 1个回答nuget安裝mongodb.driver報錯 开发语言 1个回答opencvsharp配置环境,安装opencv的问题 神经网络机器学习开发语言 1个回答上游消息 - iOS GCM iosphp 1个回答无法在visual studio 2015中安装memcached memcachednugetphp 1个回答VS2019中 web api跨域问题 config.EnableCors方法错误,不识别 visual studioasp.net 1个回答c#中EF架构code first的查询问题 sqlc# 1个回答vs2017添加dockerfile文件后项目报错 visual studioc#asp.netmicrosoft 2个回答关于Nuget Package的问题,有没有大牛了解 应用visual studio 1个回答VS2017_.net EF6.20 MySql 数据向导闪退 数据库netmysql 1个回答myeclipse 导入项目注意什么 ,经常报错 开发工具eclipse 2个回答C# 64位程序调用第三方32位dll,请问这种方案是否可行? 通信c#32位socket64位 5个回答VS2017编译jsoncpp出现的问题 jsonvisual studio 1个回答这个visual studio插件叫什么 code samples插件visual studio 1个回答vs2012数据库连接出问题 vs2012c# 1个回答对路径的访问被拒绝。 c# 5个回答VS编译没问题,生成的文件执行就出错 c语言 2个回答Code First 数据库迁移错误 类型 Configuration 不是迁移配置类型 codefristmvc数据库迁移c#net 2个回答 点击登录 提问题 欢迎建议意见 . 如何写高质量提问和回答? 采纳榜7天 被采纳次数 ProfSnail 25 幻灰龙 19 qq_34124780 154 coagenth 115 规则边缘 116 GoCityPass新加坡曼谷通票 117 cpp_learner 98 Jack_Yang(数据分析及可视化) 99 我不喜欢这个世界 810 天际的海浪 6 加急问题 500 500 基于tensorflow的模型做预测时,cpu占用率过高,如何降低程序的cpu占用率? 100 unity 设置Animation的culling type 导致游戏崩溃 100 java实现下面两个算法 100 ECDSA加密算法中,签名和验证都是需要时间的,那其时间复杂度怎么用椭圆曲线参数如阶或模p来表示呢? 75 数据库只有myd文件没有frm,myi文件,怎么打开呢 51 利用Adams联合matlab仿真求运动学反解问题 50 labview使用datasocket与c/c#程序的通信 50 如何用C语言实现凯撒密码对文本文件(.txt)的读取穷举暴力破解? 50 已知地图GPS坐标点A和坐标点B,获取A点往B点直线走一定距离的坐标点经纬度? 50 用java实现以下算法

本文链接: http://numinor.immuno-online.com/view-685911.html

发布于 : 2021-03-24 阅读(0)