Your SlideShare is downloading. ×
Organize your chickens: NuGet for the enterprise
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Organize your chickens: NuGet for the enterprise

4,524
views

Published on

Managing software dependencies, whether those created in-house or from third parties can be a pain in the behind. Whether dependencies feel like wild chickens or people run around like chickens …

Managing software dependencies, whether those created in-house or from third parties can be a pain in the behind. Whether dependencies feel like wild chickens or people run around like chickens dealing with dependencies, the NuGet package manager can be a cure. Let us guide you to creating enterprise (chicken) NuGets and dealing with them in a structured, easy-to-maintain manner. From developer workstation to build server, NuGet tastes great! We'll provide you the dip sauce.

Published in: Technology

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
4,524
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
42
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • Maarten
  • Maarten
  • Xavier
  • Xavier
  • Xavier
  • XavierMaarten
  • Maarten
  • NuGet Install-PackageWhen you use NuGet to install a package, it copies the library files to your solution and automatically updates your project (add references, change config files, etc). NuGet Uninstall-PackageIf you remove a package, NuGet reverses whatever changes it made so that no clutter is left.
  • Xavier: Terugverwijzen naar “Marketing versioning”
  • Xavier
  • Maarten
  • Maarten
  • Maarten
  • XavierStart with empty MVC template + addNuGet.ServerpkgRun siteDrop pkgs in packages folderRefresh browserFeed toevoegen in VS & show pkgs
  • Xavier
  • Maarten
  • MaartenInloggen en feed aanmakenPackage pushen vanuit NPEFeed toevoegen aan VSOp MyGet feed security instellenPackage installen in VS en tonen dat er basic auth bijkomtPackage vanNuGet toevoegen op MyGet en tonen dat je alle dependencies kan meepakken, mirroring, … en dat je ook gewoon van uw packages.config kan toevoegen
  • Xavier
  • Xavier
  • Xavier
  • Maarten
  • Maarten
  • Xavier- Het feit dat NuGet.org geen garanties biedt op content- Wat als mensen packages verwijderen? BUILD breaks, DEVS unhappy again
  • Maarten -> Xavier
  • Xavier
  • Xavier
  • Xavier
  • Maarten
  • Maarten
  • TODO Scaffolding? Toevoegen van functies?Eventueel de NuGet.exe plugins ook nog tonen?
  • Maarten
  • Maarten
  • Xavier
  • Xavier
  • Maarten
  • XavierMaartenXavierMaarten
  • Transcript

    • 1. Organize your chickens
      NuGet for the Enterprise
    • 2. Who are we?
      Maarten Balliauw
      Antwerp, Belgium
      www.realdolmen.com
      Focus on web
      ASP.NET, ASP.NET MVC, PHP, Azure, …
      MVP Windows Azure (formerly ASP.NET)
      http://blog.maartenballiauw.be
      @maartenballiauw
    • 3. Who are we?
      Xavier Decoster
      Antwerp, Belgium
      www.realdolmen.com
      Focus on web/ALM
      Visual Studio, TFS, Scrum, ...
      Silverlight, ASP.NET, ASP.NET MVC, …
      http://www.xavierdecoster.com
      @xavierdecoster
    • 4. Agenda
      Chickens?
      NuGet
      Scenarios
      Host your own NuGet repository
      Continuous (Package) Integration
      (Ab)usingNuGet
      Conclusion
    • 5. Welcome to Dll Hell
      Dependency Hell
    • 6. WelcometoDependency Hell
      “A term for the frustrationof software users who have installedsoftware packageswhich have dependencieson specificversionsof other software packages.”
      Source: Wikipedia
    • 7. Causeand Effect
      Reinventing the wheel
      We don’tneedthatdependency
      “If they can do it, we can do it, but better”
      Marketing does the versioning
      People are waitingfor v2 tobuy
      Let’s call it v4 Platform Update SP3 November Edition KB2348063 RTW Refresh
       Whathappenedtoreuse of components?
       We lost ownership of AssemblyVersion ?
    • 8. Package Management
      Using NuGet
    • 9. Package Management
      NuGet to the Rescue!
      “NuGet is a Visual Studio extension that makes it easy to install and update open source libraries and tools in Visual Studio.”
    • 10. Package What?
      Package Management
      Simple concept
      Find Packages
      (Re)Use Packages
      Produce Packages
      “…a collection of software tools to automate the process of installing, upgrading, configuring, and removingsoftware packages…”
      Wikipedia
    • 11. GettingStarted
      Tooling:
      NuGet Package Manager (http://nuget.org)
      NuGet Package Explorer (http://npe.codeplex.com)
      Install-Package NuGetPowerTools
      Install-Package NuGet.CommandLine
      Guidanceanddocumentation
      http://docs.nuget.org
    • 12. Consuming Packages
      Simple as adding a reference
    • 13. Onedialogtorulethemall…
      Install-Package
      Update-Package
      Uninstall-Package
      Settings
      Package Sources
      Local (offline) Cache location
      Also: Manage packages on solution level!
      Right-click solution > Manage NuGet Packages…
    • 14. NuGet Package Manager Console
      PowerShellenabled!
      Extensible!
      Scaffolding, NuGetPowerTools, …
      %UserProfile%DocumentsWindowsPowerShellNuGet_profile.ps1
    • 15. Configurable Package Sources
      Configurablethrough…
      NuGet Library Package Manager (VS add-in)
      NuGet.config (in %APPDATA%RoamingNuGetNuGet.config)
      NuGet.settings.targets (MSBUILD file part of NuGetPowerTools)
    • 16. Creating Packages
      What’s a package?
      Just a zip-filecontaining:
      … content and source code (tobeinjectedinto target project)
      … PowerShell scripts andexecutables
      … configuration file and source code transformations
      http://docs.nuget.org/docs/creating-packages/Configuration-File-and-Source-Code-Transformations
    • 17. Package Conventions
      Conventions
      http://docs.nuget.org/docs/creating-packages/Package-Conventions
      Folder structure
      Tools (init.ps1, install.ps1, uninstall.ps1)
      Content
      Manifest (.nuspec file)
      Lib
    • 18. NuGet Manifest Specification
      NuSpec manifest
      XML file (with XSD available)
      Package metadata
    • 19. Semantic Versioning
      Think about your versioning! (semver.org)
      Always specifylowerbound
      Use a version range (lowerbound + upperbound) whenversioning of package youdepend on is messed up
    • 20. Advanced usage scenarios
      Host your own NuGet repository
      Continuous (Package) Integration
      (Ab)using NuGet
    • 21. Hosting your own repository
      Those chickens are mine!
    • 22. Hosting your own repository
      NuGet = public feed
      Privacy
      Intellectual property
      NuGet maintained by package authors
      Author removes v1.0.45 and you depend on it
    • 23. Solutions
      Folder / File share
      Orchard Gallery (or NuGet Gallery)
      NuGet.Server package
      MyGet
    • 24. NuGet.Server Demo
      Install-Package NuGet.Server
    • 25. NuGet.Serverlimitations
      Only 1 feed per installation
      No UI: up toyoutobuildit
      No granular security: only 1 API-keyforentire feed
      Conclusion: requiresyoutodevelopifyou want something more useful
    • 26. Meet MyGet
      www.myget.org
      NaaS
      Register and off you go! (no dev)
      Supports Enterprise scenarios
      Granular security
      Package mirroring
    • 27. MyGet Demo
      Log in to www.myget.org and get started
    • 28. Continuous (Package) Integration
      Fetch the chickens when you need them
    • 29. Typical source control...
      Contains /References (if you are lucky)
      ...and also Project/_bin_deployable_assemblies
      ...and also /References/old
      ...and also /..././../.././References
      Usually references GAC-ed assemblies
    • 30. Dependencies
      Software has dependencies. Deal with it.
      But are those YOUR intellectual property?
      YOUR reason to build software?
      YOUR product?
      No. They are dependencies. And they don’t belong in source control.
    • 31. Continuous (Package) Integration
      Can I get rid of all these referencedassembliesduplicatedall-over my source control system?
      • Yes!
      Do I needtoinstallandmaintainNuGet on allmybuildagents?
      • No!
    • NuGetPowerTools Demo
      Organize your build chickens!
    • 32. 3rd partiesdon’tbelong in your SCM
      Source control bloatedwiththird-party binaries?
      Replacethem with NuGet packages
      Commitpackages.config/repositories.config files
      Preferablynot the packages
      Use NuGetPowerTools
      Enable-PackageRestore
    • 33. Problem!
      NuGet feed is subject to change...
      PackageSourceMSBuild property to the rescue
      NuGet.settings.targets in $(SolutionDir).nuget folder
      Nowwhat...
      Host yourown feed andmirrorthird-party packages
      InternalNuGet.Server
      Network Share
      Or useMyGetforthat
    • 34. Organizeyourchickens
      Feed structuring
      Scopedbyquality: Build, QA, Production, …
      Scopedbyaudience: public, restricted access
      Other:
      Scopedby product version, milestone…
      Scopedby target platform
    • 35. (Ab)using NuGet
    • 36. Guidance
      Publishing a package bringsgreatresponsibility
      Breakingchanges in your packages shouldbeversionedaccordingly!
      Consumersmightchooseto no longerconsumeany packages youpublished
    • 37. Guidance
      Package Integration ≠ Integration Testing
      CI buildsreflect output of source control input
      Same input alwaysproducessame output
      Do not auto-update packages duringautomatedbuilds!
    • 38.
    • 39. (Ab)using NuGet?
      Change of perspective
      NuGet as a package manager
      NuGet as a protocol for distributing packages
    • 40. ExtendingNuGet
      Scaffolding, CmdLets, Plug-ins, …
    • 41. Scaffolding
      T4, Mvc, …
      CreateyourownPowerShellcmdlets
      Automate Visual Studio (access to DTE)
    • 42. Automate deployments
      Build results in .nupkg
      Octopus deploys to its tentacles
      Test tentacles
      Staging tentacles
      Production tentacles
      www.octopusdeploy.com
    • 43.
    • 44. NuGet command line plug-ins
      Extend NuGet.exe
      Custom Commands
      How?
      Build class library
      Reference NuGet.exe
      Inherit Command
      Deploy your dll to %LocalAppData%NuGetCommands
    • 45. Chocolatey
      NuGet
      developer library packages
      Chocolatey
      applications and tools packager
      “yum” or “apt-get” for Windows
      www.chocolatey.org
    • 46. Chocolatey Demo
      NuGet desert
    • 47. Orchard / WebMatrix / …
      NuGetnotboundto VS
      Orchard CMS: modules & themes
      WebMatrix: install page helpers on the fly
      Yourapp: offer pluginsthrough a repo
    • 48. Conclusion
    • 49. Dependencies & people are chickens
      • Deal with them! NuGet can help
      Set up your own NuGet repository for various reasons
      Continuous package integration
      NuGet is a package manager
      • NuGet is a protocol
      Conclusion
    • 50. Thank you!
      Any questions?
      http://blog.maartenballiauw.be
      @maartenballiauw
      http://www.xavierdecoster.com
      @xavierdecoster