Nuget 包的重点是什么? [英] What is the point of Nuget packages?

查看:60
本文介绍了Nuget 包的重点是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许我在这里做错了什么或表达了纯粹的无知,但我真的看不出 Nuget 包有什么好处?我最近决定安装一些 Nuget 包来替换我的应用程序中的静态 DLL.当我检查由包创建的文件夹时,它们似乎包含许多不同版本的 DLL,所有版本都嵌套在一系列子目录下.

Maybe I'm doing something wrong or expressing pure ignorance here, but I can't really see how Nuget packages are beneficial? I recently decided to install a number of Nuget packages to replace the static DLLs in my application. When I inspect the folders that are created by the packages they seem to include many different versions of the DLL all nested under an array of sub directories.

难道所有这些文件(其中许多看起来是多余的)会增加应用程序的整体大小并减慢发布和部署例程的速度吗?还有哪些项目应该放在源代码管理中?

Don't all these files, many of which appear to be redundant increase the overall size of the application and slow down the publish and deploy routine? Also which items should be placed into source control?

就像我说的那样,我可能在这里遗漏了一些东西,但有人可以启发我了解 Nuget 软件包的优点吗?我开始认为 bin 文件夹中的一个简单的 dll 工作得很好?

Like I said I may be missing something here but can anybody enlighten me on the virtues of Nuget packages? I'm starting to think that a simple dll in the bin folder worked perfectly fine?

推荐答案

  1. 每个软件包都知道它依赖于哪些其他软件包——特别是它们的哪些版本.这有助于确保所有库都兼容.
  2. 您仍然只应该部署您实际需要的 DLL 版本
  3. 您可以决定不将任何 DLL 放入您的源代码管理中,因为 NuGet 具有包还原"功能,可以在构建时自动加载丢失的包.
  4. 您拥有所有依赖项的中心位置:只需右键单击您的项目并选择您需要的包.无需再搜索下载链接等
  1. Each package knows what other packages - and specifically what versions thereof - it depends on. That helps to make sure all libraries are compatible.
  2. You still only should deploy that DLL version you actually need
  3. You can decide to not put any DLLs into your source control, because NuGet has a "Package Restore" feature that automatically loads missing packages on build.
  4. You have a central place for all your dependencies: Just right-click on your project and choose the packages you need. No more searching for download links etc.

这篇关于Nuget 包的重点是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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