如何处理 Nuget 中不兼容的依赖关系?我可以排除对安装的依赖吗?
我在应用程序之上安装了 Nuget。 Nuget 依赖于比基本应用程序更新版本的第 3 方 dll,因此现在基本应用程序无法运行。那要怎么照顾呢?这是否表明 Nuget 或基础应用程序违反了良好原则?
Afaiu 基础应用程序需要第 3 方 dll 的精确版本(并且 Nuget 需要更高版本)。
是使用更新的引用重新编译基本应用程序的唯一方法 - 或者使用旧的 dll 版本的引用重新编译 Nuget 吗?
一种可能的解决方法是安装 Nuget,而不自动安装较新版本的第 3 方 dll,但我不知道该怎么做。
I installed a Nuget on top of an application. The Nuget had a dependency to a newer version of a 3rd party dll than the base application, and now the base application cannot run because of this. How to take care of that? Is this a sign that either the Nuget or the base application violates good principles?
Afaiu the base application requires an exact version of the 3rd party dll (and the Nuget requires a later version).
Is the only way to recompile the base application with updated refs - or recompile the Nuget with ref to the older dll version?
A possible workaround could be to install the Nuget withouth automatically installing the newer version of the 3rd party dll, but I don't know how to do that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
虽然很杂乱,但我会将基础应用程序所需的旧版本库安装到 GAC。这并不理想,必须在安装场景中考虑到这一点,但 GAC 确实允许引用同一库的多个版本。
It's kludgey, but I would install the older version of the library that the base application requires to the GAC. This isn't ideal, and will have to be accounted for in your installation scenario, but the GAC does allow multiple versions of the same library to be referenced.