项目参考VS NuGet

编程入门 行业动态 更新时间:2024-10-28 07:21:35
本文介绍了项目参考VS NuGet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在相同的解决方案中,如何引用project B中的另一个project A? 如果我获得了什么,我会有什么损失?

How should I reference to another project A from project B in the same solution? What do I gain and what do I lose if I:

  • 将引用添加到project A作为项目引用.
  • 在project B中安装project A的NuGet软件包.
  • Add the reference to project A as a project reference.
  • Install the NuGet package of project A in project B.

让我烦恼的是构建依赖项,版本控制..? 还是这完全破坏了解决方案的目的?

Things that would bother me are build dependencies, versioning..? Or does this totally destroy the purpose of a solution?

推荐答案

使用第一种方法,您将获得简化,因为您无需生成ProjectA nuget软件包的新版本,因此无需对它进行任何更改. (即ProjectA.nupkg).

With the first approach, you gain in simplicity, since you don't need to generate a new version of the ProjectA nuget package, every change you make in it (i.e. ProjectA.nupkg).

但是,通过第二种方法,由于您可以轻松地与其他项目/解决方案共享相同的nuget包,因此您具有可移植性.

However, with the second approach, you gain in portability, since you can easily share the same nuget package with other projects / solutions.

我个人仅为目标是与其他解决方案共享的项目创建nuget软件包. (例如lib和框架).

Personally, I create nuget packages only for projects whose goal is to share with other solutions. (E.g. libs and frameworks).

希望这可以帮助您做出决定!

Hope this helps you decide!

更多推荐

项目参考VS NuGet

本文发布于:2023-11-08 08:12:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1568835.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:项目   NuGet

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!