.NET Package Management: NuGet and Beyond
Rick Tuttle
@ricktuttle
Package Management
- Package: code you want in your project
- Registry: public repository of packages
- Package Manager: gets the stuff for you and puts it in your project
![](https://s3.amazonaws.com/media-p.slid.es/uploads/57093/images/1506233/Screen_Shot_2015-06-18_at_2.07.18_PM.png)
You have used one of these...
- Windows Update
- Web Platform Installer
- rpm (RedHat)
- apt-get (Debian, Ubuntu)
- Homebrew (Mac OS X)
- App Store
ASP.NET Adoption of Web Tooling and OSS
- 2007: MVC (Rails)
- 2010 NuGet (Ruby gems)
- Scaffolding
- Node, NPM, Bower, Grunt/Gulp
Good artists copy. Great artists steal.
- Steve Jobs
NuGet
- nuget.org
- Part of Visual Studio
- Package Manager Console
- Package Manager Dialog
- Can deliver front/back end components
- Best for .NET Components
![](https://s3.amazonaws.com/media-p.slid.es/uploads/57093/images/1505162/nuget.png)
Adding a NuGet Package
- Package contents downloaded to packages folder
- References added to binaries
- Support files added to project
- Web.config parameters added
NuGet Demo
(and a little choco)
We Have Issues
- NuGet works great for .NET binaries
- Not so good for front-end components
- Files get added to project inconsistently
- We need more control!
Bower
- bower.io
- Requires Node, npm, git
- Can be used in alongside Nuget
- Manage your javascript, css, font assets
![](https://s3.amazonaws.com/media-p.slid.es/uploads/57093/images/1505148/bower-logo.png)
Node.js
- Server runtime built with Javascript
- Can be used as a harness to run front end utilities like bower, grunt, gulp, yeoman, etc.
- Install on Win or Mac using an install executable/dmg
- OR install with Chocolatey
NPM
- Node Package Manager
- Use it to install software that "runs in" Node.js
- Even if not using Node.js for your project you use NPM to manage your "tooling" to build your project
Bower
- Installs packages in your project
- Front-end Assets like JS, CSS, Fonts
- Uses public registry like NuGet except WAY more packages/projects available
- Gets source from github repos
- Manage versions
- Flexible configuration
Bower + Gulp
- Manage the versions of your front-end assets with Bower
- Use Gulp to add your .js and .css <script> includes
- Use Gulp for minification, combining scripts, running tests, cache busting!
- Grunt is another alternative
![](https://s3.amazonaws.com/media-p.slid.es/uploads/57093/images/1506239/gulp-2x.png)
![](https://s3.amazonaws.com/media-p.slid.es/uploads/57093/images/1506241/gruntlogo.png)
Bower + Gulp Demo
The Future's So Bright...
- ASP.NET 5 and VS 2015
- Node, NPM, Bower, Grunt, Gulp
- You're in control bro, rock on!
- OMG. I'm in control. Bruh.
![](https://s3.amazonaws.com/media-p.slid.es/uploads/57093/images/1505345/timbuk_3_the_futures_so_bright_I_gotta_wear_shades_1986_the80sman.jpg)
Some References
- John Papa - Pluralsight - Javascript Build Automation with Gulp
- Channel 9 - Build 2015 Mads Kristensen - Modern Web Tooling in Visual Studio 2015
- docs.asp.net
Questions?
Rick Tuttle
@ricktuttle
Package Management in .NET
By papasoft
Package Management in .NET
.NET Package Management: NuGet and Beyond
- 1,488