gpt4 book ai didi

asp.net-mvc - 升级到 ASP.NET MVC 5 和 Web API 2 后如何解决 nuget DLL hell

转载 作者:行者123 更新时间:2023-12-04 07:02:28 24 4
gpt4 key购买 nike

我已经按照这些 steps from this WebSite 将 ASP.NET MVC4 升级到 ASP.NET MVC 5.1

我在升级 nuget 包时陷入困境,有很多错误和回滚:

例如

Install failed. Rolling back...
Install-Package : Updating 'Microsoft.AspNet.WebApi.Core 4.0.20710.0' to
'Microsoft.AspNet.WebApi.Core 5.1.0' failed. Unable to find a version of
'Microsoft.AspNet.WebApi.OData' that is compatible with 'Microsoft.AspNet.
WebApi.Core 5.1.0'.

或者
Update-Package : Updating 'Microsoft.Net.Http 2.0.20710.0' 
to 'Microsoft.Net.Http 2.2.18' failed. Unable to find versions of
'Microsoft.AspNet.WebApi.Client, Microsoft.AspNet.WebApi.OData' that
are compatible with 'Microsoft.Net.Http 2.2.18'.

是否有一些简单的步骤来清理和更新所有内容并摆脱这个 DLL hell ?

最佳答案

删除项目中所有 nuget 包的快速方法是手动编辑 packages.config 文件,然后删除所有 dll 引用(仅适用于 nuget 包中的 dll)。

这比通过 nuget 包管理器卸载需要的时间少得多,尤其是当有如此大的依赖树时。

关于asp.net-mvc - 升级到 ASP.NET MVC 5 和 Web API 2 后如何解决 nuget DLL hell ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21351850/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com