Why we need a package manager like Nuget?

妖精的绣舞 提交于 2019-11-29 04:35:41

It's value is hidden in the open: a package manager such as NuGet helps you dealing with software dependencies using automation. Many make the assumption that it's only meant for open source or third party components, but you could equally as well use it for your own internal packages.

The great thing about NuGet is (to name a few benefits):

  • NuGet encourages reuse of components because you implicitly rely on actual "releases" (even if pre-release), instead of branching sources
  • you can get rid of binaries bloating your VCS repositories (package restore feature)
  • it forces package creators to think about the way the package will be consumed and leaves them dealing with configuration of the component during package installation (who knows best how to configure the package than the package creators?). Think about ELMAH as an example.
  • automating package creation and publication on a package repository effectively is a form of continuous delivery (for software components). OctopusDeploy even takes it a step further and enables packaging entire Web sites ready for deployment.
  • NuGet encourages and sometimes enforces you to follow some ALM best practices. E.g. a package has a version, so you have to think about your versioning strategy (e.g. SemVer.org)
  • NuGet integrates with SymbolSource.org (which also has a Community edition to set up your own): this allows one to easily debug released packages without having to ship this info all the time
  • having one or more package repositories makes it easy for the organization to maintain a dependency matrix, or even build an inventory of OSS licenses that are in use by several projects
  • NuGet notifies you about available package updates
  • Creating packages makes people think about component architecture (all dependencies should be packaged as well)
  • Dependencies of a package are automatically resolved (so you can't forget any)
  • NuGet is smart enough to add assembly binding redirects when required

The above list is non-exhaustive, but I hope I covered the key benefits in this answer. I'm sure there are more.

Cheers, Xavier

Reason to use NuGet is you don't have to ship all the libraries in your project, reducing the project size. With NuGet Power Tools, by specifying the package versions in the Packages.config file, you will be able to download all the required libraries the first time you run the project.

Live Exapmle : Reduced project size matters while deployment of project.Like if solution have 500Mb of code and 200Mb of packages size then extra 200mb really cost to upload project each time.Instead of uploading concrete dll files we need to just set their reference in packages.config file.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!