Using nu get the way you should svcc

Maarten Balliauw
Maarten BalliauwDeveloper Advocate
Using NuGet 
the way you should 
Maarten Balliauw 
@maartenballiauw
Who am I? 
• Maarten Balliauw 
• Antwerp, Belgium 
• Developer Advocate, JetBrains 
• Founder, MyGet 
• AZUG 
• Focus on web 
• Big passion: Azure 
• http://blog.maartenballiauw.be 
• @maartenballiauw 
Shameless self promotion: Pro NuGet - 
http://amzn.to/pronuget2
Agenda 
• NuGet 
• File | New Project… 
• The state of NuGet 
• Every project is a package 
• Creating packages 
• Distributing packages 
• Consuming packages
NuGet
A brief NuGet introduction... 
• Package management system for .NET 
• Visual Studio extension, command line, console 
• Simplifies incorporating 3rd party libraries 
• Developer focused 
• Free, open source 
• Use packages from the official feed 
• Publish your own packages 
• Create & use your own feed
File | New 
Project...
Demo 
File | New Project...
That was trouble! 
Dependency hell 
•Dependencies on NuGet packages 
•Dependencies on projects 
•Dependencies on file system layout 
• Breaking changes in dependencies
“Dependencies, also in real 
life, are trouble. Have you 
ever had to depend on a 
plumber showing up?” 
- Maarten Balliauw
Dependencies before NuGet 
• Projects in solution 
•Reference in-house projects: 
• Either the assemblies (typically unversioned / all 1.0.0.0) 
• Either the actual project / linked files (unversioned by design) 
•Reference third party assemblies (e.g. JSON.NET)
Dependencies with NuGet 
• Projects in solution 
•Reference in-house projects: 
• Either the assemblies (typically unversioned / all 1.0.0.0) 
• Either the actual project / linked files (unversioned by design) 
•Reference third party packages (e.g. JSON.NET) 
• Semantic Versioning to announce breaking changes 
(happy times as long as package authors respect that)
The state of 
NuGet
The state of NuGet 
Where are we, 3 years in? 
•We are consumers! 
• Even quite some overconsumption I dare say… 
•We sort of know about Semantic Versioning 
• If the mayor version changes, we’re doomed 
•Are we producing? 
• Some are, e.g. OSS and some companies 
• Did we solve our dependency issues?
.NET is late to the party! 
•Others have been doing package management for 
decades 
• Perl (CPAN.org) 
• Linux (RPM/YUM/APT-GET/...) 
• PHP (PEAR, Composer) 
• Node (npm) 
• Ruby (Gems) 
•We can learn a great deal from these!
What are the others doing? 
{ 
"name" : "IniTech.Framework.Formatters", 
"version" : "1.0.0 ", 
"author" : "Maarten Balliauw", 
"bugs" : { "url" : "https://github.com/initech/framework-formatters/issues" }, 
"description" : "Formatters specific to the IniTech organization.", 
"homepage" : "https://github.com/initech/framework-formatters", 
"keywords" : [ "framework", "formatters", "initech" ], 
"license" : "Proprietary", 
"main" : "index.js", "repository" : { "type" : "git", 
"url" : "https://github.com/initech/framework-formatters" 
}, 
"scripts" : { "test" : "echo "Error: no test specified" && exit 1" }, 
"dependencies" : { 
"date-format" : "0.0.2", 
"format" : "~0.2.1", 
"moment" : "~2.5.1" 
} 
}
What are the others doing? 
What was in that package.json? 
•Name and version of the project 
•Dependencies (and version range) of the project 
• Every project is a package! 
• It can have dependencies 
• It can be depended on
Every project is a 
package
Supporting componentization 
• Every project is a package 
• Clearly identifyable 
• Proper Semantic Versioning 
• Every project becomes discoverable 
• Nice description, release notes, ... 
• Add it to a private feed so developers can find it 
•Dependencies (can) stay out of source control 
•Dependencies are versioned
But… NuGet only has packages.config! 
•Nodejs: packages.json 
•Composer (PHP): composer.json 
•NuGet: 
• packages.config: dependencies 
• <projectname>.nuspec: package description 
• NuGet.config: other settings 
• It’s 2-3 files in our world, but it is all there. 
• Let’s become producers!
Creating packages
All we need is one file 
<projectname>.nuspec 
• XML file which can be generated 
• nuget.exe spec 
• Install-Package NuSpec && Install-Nuspec 
•Run nuget.exe pack to create package
Demo 
Creating packages
Think about versioning! 
Enforce Explicit Semantic Versioning 
• www.semver.org 
Major Breaking changes 
Minor Backwards compatible changes 
e.g. API additions 
Patch Bugfixes not affecting the API 
• SemVer states intentions 
• It’s the only way to 
avoid dependency 
versioning hell. 
But not bullet-proof. 
<dependency id="ExamplePackage" version="1.3.2" /> 
1.0 = 1.0 ≤ x 
(,1.0] = x ≤ 1.0 
(,1.0) = x < 1.0 
[1.0] = x == 1.0 
(1.0) = invalid 
(1.0,) = 1.0 < x 
(1.0,2.0) = 1.0 < x < 2.0 
[1.0,2.0] = 1.0 ≤ x ≤ 2.0 
empty = latest version
Distributing packages
Which medium? 
We will need a “package source” or feed 
• In source control (please don’t) 
• Local / network folder (slow > ~50 packages) 
• NuGet.Server (slow > ~50 packages) 
• NuGet Gallery (clone of www.nuget.org) 
• MyGet (www.myget.org, SaaS) 
• ProGet (www.inedo.com/proget) 
• TeamCity NuGet artifacts (www.jetbrains.com/teamcity) 
• Sonatype (www.sonatype.com/nexus) 
• Artifactory (www.jfrog.com)
How do they get there? 
•Manual upload 
• As part of our continuous integration process 
• All benefits of CI (e.g. testing) 
• Plus reporting on which packages we are using 
• Plus publishing packages for consumption
Demo 
Continuous Integration 
& Distributing Packages with TeamCity
What did we just see? 
•Creating packages using .nuspec 
•NuGet configuration inheritance 
•Continuous Integration on TeamCity 
• How to run package restore 
• How to build a package 
• How to see packages that are being used 
•How to consume a package
NuGet configuration inheritance 
•Make settings common to projects! 
• NuGet walks up the directory tree to find NuGet.config files 
• Or even push them to developer machines 
• %AppData%NuGetNuGet.config 
• %ProgramData%NuGetConfig*.config 
• ... 
•See http://bit.ly/nuget-config-inheritance 
• Configure feeds, proxy, credentials, ...
More recommendations… 
• Don’t just update blindly 
• Not everyone respects SemVer… 
• It would take us back to the original problem 
• Don’t autoupdate during builds 
• Continuous Integration: Same Input = Same Output 
• Be explicit about versioning
Deploying from NuGet packages 
•Using a simple, handcrafted script 
• Using a tool like OctopusDeploy.com 
• Which is even cooler combined with Chocolatey.org 
•TeamCity supports various ways of deploying (e.g. 
WebDeploy)
Demo 
Deploying packaged applications 
with a handcrafted script
Considerations 
•TeamCity internal NuGet feed 
• Only build artifacts 
• No way to add external packages that are being used 
• May not be a problem for your setup 
• But maybe it is: a feed is much like source control for dependencies 
• Add dependencies that are being used, NuGet.org, component 
vendors, ... 
• If it is, create your own feed, e.g. MyGet.org
Create a package source / feed 
For your team or the entire organization 
• That’s a cool library! And that one too! 
• Avoid overconsumption by limiting packages 
• May not block developers but at least the build will fail 
• Your own feed will only contain packages you 
know 
• Keep versions under control 
• Keep licensing under control 
• Easy way to audit external packages in use
Demo 
Pushing packages from TeamCity
But I’m using NuGet. It’s broken!!! 
http://blog.nuget.org/20141010/nuget-is-broken. 
html 
• Tied to Visual Studio 
•Merging sucks (XML merge, yuck!) 
•Updating fails often 
• Disk space pollution 
• Project re-targeting 
•Pessimistic package version picker / fixed versions
Demo 
ASP.NET vNext approach is the way forward!
Conclusions
Conclusions 
What have we learned? 
• NuGet 
• File | New Project… 
• The state of NuGet 
• Every project is a package 
• Creating packages 
• Distributing packages 
• Consuming packages
“Project references must 
die. Embrace NuGet by 
consuming and creating 
packages. It’s a logical 
evolution.” 
- Maarten Balliauw
Thank you! 
http://blog.maartenballiauw.be 
@maartenballiauw 
http://amzn.to/pronuget2
1 of 41

Recommended

Organize your chickens: NuGet for the enterprise by
Organize your chickens: NuGet for the enterpriseOrganize your chickens: NuGet for the enterprise
Organize your chickens: NuGet for the enterpriseMaarten Balliauw
1.6K views38 slides
Using NuGet the way you should - TechDays NL 2014 by
Using NuGet the way you should - TechDays NL 2014Using NuGet the way you should - TechDays NL 2014
Using NuGet the way you should - TechDays NL 2014Maarten Balliauw
2.5K views43 slides
Evolution of NuGet by
Evolution of NuGetEvolution of NuGet
Evolution of NuGetJeff Handley
305 views34 slides
Windows Just Got Chocolatey (Package Management) LISA15 by
Windows Just Got Chocolatey (Package Management) LISA15Windows Just Got Chocolatey (Package Management) LISA15
Windows Just Got Chocolatey (Package Management) LISA15Rob Reynolds
1.3K views43 slides
Puppet Camp LA 2015: Package Managers and Puppet (Beginner) by
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)Puppet Camp LA 2015: Package Managers and Puppet (Beginner)
Puppet Camp LA 2015: Package Managers and Puppet (Beginner)Puppet
2.2K views87 slides
Package Management and Chef - ChefConf 2015 by
Package Management and Chef - ChefConf 2015Package Management and Chef - ChefConf 2015
Package Management and Chef - ChefConf 2015Chef
999 views88 slides

More Related Content

What's hot

2011 - Dotnet Information Day: NUGET by
2011 - Dotnet Information Day: NUGET2011 - Dotnet Information Day: NUGET
2011 - Dotnet Information Day: NUGETDaniel Fisher
486 views44 slides
PuppetConf 2016: Easily Manage Software on Windows with Chocolatey – Rob Reyn... by
PuppetConf 2016: Easily Manage Software on Windows with Chocolatey – Rob Reyn...PuppetConf 2016: Easily Manage Software on Windows with Chocolatey – Rob Reyn...
PuppetConf 2016: Easily Manage Software on Windows with Chocolatey – Rob Reyn...Puppet
501 views76 slides
Puppet On Windows - Puppet Camp DC 2015 by
Puppet On Windows - Puppet Camp DC 2015Puppet On Windows - Puppet Camp DC 2015
Puppet On Windows - Puppet Camp DC 2015Rob Reynolds
871 views21 slides
Mono Repo by
Mono RepoMono Repo
Mono RepoZacky Pickholz
1.4K views50 slides
The New Frontend Toolchain by
The New Frontend ToolchainThe New Frontend Toolchain
The New Frontend ToolchainBruno Abrantes
1.4K views23 slides
Modulesync- How vox pupuli manages 133 modules, Tim Meusel by
Modulesync- How vox pupuli manages 133 modules, Tim MeuselModulesync- How vox pupuli manages 133 modules, Tim Meusel
Modulesync- How vox pupuli manages 133 modules, Tim MeuselPuppet
184 views24 slides

What's hot(20)

2011 - Dotnet Information Day: NUGET by Daniel Fisher
2011 - Dotnet Information Day: NUGET2011 - Dotnet Information Day: NUGET
2011 - Dotnet Information Day: NUGET
Daniel Fisher486 views
PuppetConf 2016: Easily Manage Software on Windows with Chocolatey – Rob Reyn... by Puppet
PuppetConf 2016: Easily Manage Software on Windows with Chocolatey – Rob Reyn...PuppetConf 2016: Easily Manage Software on Windows with Chocolatey – Rob Reyn...
PuppetConf 2016: Easily Manage Software on Windows with Chocolatey – Rob Reyn...
Puppet501 views
Puppet On Windows - Puppet Camp DC 2015 by Rob Reynolds
Puppet On Windows - Puppet Camp DC 2015Puppet On Windows - Puppet Camp DC 2015
Puppet On Windows - Puppet Camp DC 2015
Rob Reynolds871 views
The New Frontend Toolchain by Bruno Abrantes
The New Frontend ToolchainThe New Frontend Toolchain
The New Frontend Toolchain
Bruno Abrantes1.4K views
Modulesync- How vox pupuli manages 133 modules, Tim Meusel by Puppet
Modulesync- How vox pupuli manages 133 modules, Tim MeuselModulesync- How vox pupuli manages 133 modules, Tim Meusel
Modulesync- How vox pupuli manages 133 modules, Tim Meusel
Puppet184 views
Visug - organize your chickens - nuget for the enterprise by Xavier Decoster
Visug - organize your chickens - nuget for the enterpriseVisug - organize your chickens - nuget for the enterprise
Visug - organize your chickens - nuget for the enterprise
Xavier Decoster1.3K views
Chocolatey and Puppet: Managing Your Windows Software Since 2011 by Rob Reynolds
Chocolatey and Puppet: Managing Your Windows Software Since 2011Chocolatey and Puppet: Managing Your Windows Software Since 2011
Chocolatey and Puppet: Managing Your Windows Software Since 2011
Rob Reynolds1.2K views
npm + browserify by maxgfeller
npm + browserifynpm + browserify
npm + browserify
maxgfeller6.1K views
8-9-10=Jessie,Stretch,Buster by Hideki Yamane
8-9-10=Jessie,Stretch,Buster8-9-10=Jessie,Stretch,Buster
8-9-10=Jessie,Stretch,Buster
Hideki Yamane2.3K views
Understanding NuGet implementation for Enterprises by J S Jodha
Understanding NuGet implementation for EnterprisesUnderstanding NuGet implementation for Enterprises
Understanding NuGet implementation for Enterprises
J S Jodha931 views
Virtual Bolt Workshop - 6 May by Puppet
Virtual Bolt Workshop - 6 MayVirtual Bolt Workshop - 6 May
Virtual Bolt Workshop - 6 May
Puppet220 views
Advantages and disadvantages of a monorepo by IanDavidson56
Advantages and disadvantages of a monorepoAdvantages and disadvantages of a monorepo
Advantages and disadvantages of a monorepo
IanDavidson561K views
How Build Infrastructure Powers the Node.js Foundation by Gibson Fahnestock
How Build Infrastructure Powers the Node.js FoundationHow Build Infrastructure Powers the Node.js Foundation
How Build Infrastructure Powers the Node.js Foundation
Gibson Fahnestock613 views
find & improve some bottleneck in Debian project (DebConf14 LT) by Hideki Yamane
find & improve some bottleneck in Debian project (DebConf14 LT)find & improve some bottleneck in Debian project (DebConf14 LT)
find & improve some bottleneck in Debian project (DebConf14 LT)
Hideki Yamane855 views
Janus/HOMER/HEPIC @ OpenSIPS18 by Lorenzo Miniero
Janus/HOMER/HEPIC @ OpenSIPS18Janus/HOMER/HEPIC @ OpenSIPS18
Janus/HOMER/HEPIC @ OpenSIPS18
Lorenzo Miniero1.3K views
Chocolatey Goodness: From Fringe to Mainstream #dotnetfringe by Rob Reynolds
Chocolatey Goodness: From Fringe to Mainstream #dotnetfringeChocolatey Goodness: From Fringe to Mainstream #dotnetfringe
Chocolatey Goodness: From Fringe to Mainstream #dotnetfringe
Rob Reynolds1.5K views
GDD HTML5, Flash, and the Battle for Faster Cat Videos by Greg Schechter
GDD HTML5, Flash, and the Battle for Faster Cat VideosGDD HTML5, Flash, and the Battle for Faster Cat Videos
GDD HTML5, Flash, and the Battle for Faster Cat Videos
Greg Schechter14.2K views

Viewers also liked

Developing NuGet by
Developing NuGetDeveloping NuGet
Developing NuGetJeff Handley
1.6K views33 slides
An overview of the NuGet ecosystem - Mobel.io by
An overview of the NuGet ecosystem - Mobel.ioAn overview of the NuGet ecosystem - Mobel.io
An overview of the NuGet ecosystem - Mobel.ioMaarten Balliauw
2.3K views33 slides
Fun with ASP.NET MVC 3, MEF and NuGet (#comdaybe) by
Fun with ASP.NET MVC 3, MEF and NuGet (#comdaybe)Fun with ASP.NET MVC 3, MEF and NuGet (#comdaybe)
Fun with ASP.NET MVC 3, MEF and NuGet (#comdaybe)Maarten Balliauw
2.8K views26 slides
Running in the Cloud - First Belgian Azure project by
Running in the Cloud - First Belgian Azure projectRunning in the Cloud - First Belgian Azure project
Running in the Cloud - First Belgian Azure projectMaarten Balliauw
1.2K views67 slides
NuGet vs Maven by
NuGet vs MavenNuGet vs Maven
NuGet vs MavenMiguel Fernández
9K views14 slides
Nuget is easier than you think and you should be using it as both a consumer ... by
Nuget is easier than you think and you should be using it as both a consumer ...Nuget is easier than you think and you should be using it as both a consumer ...
Nuget is easier than you think and you should be using it as both a consumer ...Justin James
3K views57 slides

Viewers also liked(20)

An overview of the NuGet ecosystem - Mobel.io by Maarten Balliauw
An overview of the NuGet ecosystem - Mobel.ioAn overview of the NuGet ecosystem - Mobel.io
An overview of the NuGet ecosystem - Mobel.io
Maarten Balliauw2.3K views
Fun with ASP.NET MVC 3, MEF and NuGet (#comdaybe) by Maarten Balliauw
Fun with ASP.NET MVC 3, MEF and NuGet (#comdaybe)Fun with ASP.NET MVC 3, MEF and NuGet (#comdaybe)
Fun with ASP.NET MVC 3, MEF and NuGet (#comdaybe)
Maarten Balliauw2.8K views
Running in the Cloud - First Belgian Azure project by Maarten Balliauw
Running in the Cloud - First Belgian Azure projectRunning in the Cloud - First Belgian Azure project
Running in the Cloud - First Belgian Azure project
Maarten Balliauw1.2K views
Nuget is easier than you think and you should be using it as both a consumer ... by Justin James
Nuget is easier than you think and you should be using it as both a consumer ...Nuget is easier than you think and you should be using it as both a consumer ...
Nuget is easier than you think and you should be using it as both a consumer ...
Justin James3K views
Unit testing with NUnit by kleinron
Unit testing with NUnitUnit testing with NUnit
Unit testing with NUnit
kleinron3.7K views
NuGet 3.0 - Transitioning from OData to JSON-LD by Jeff Handley
NuGet 3.0 - Transitioning from OData to JSON-LDNuGet 3.0 - Transitioning from OData to JSON-LD
NuGet 3.0 - Transitioning from OData to JSON-LD
Jeff Handley6.9K views
NUnit Features Presentation by Shir Brass
NUnit Features PresentationNUnit Features Presentation
NUnit Features Presentation
Shir Brass3.1K views
Easymock Tutorial by Sbin m
Easymock TutorialEasymock Tutorial
Easymock Tutorial
Sbin m20.9K views
Gestion paquetes NuGet con Visual Studio Team Services y MyGet by Luis Fraile
Gestion paquetes NuGet con Visual Studio Team Services y MyGetGestion paquetes NuGet con Visual Studio Team Services y MyGet
Gestion paquetes NuGet con Visual Studio Team Services y MyGet
Luis Fraile1.2K views
Domain-Driven Design with ASP.NET MVC by Steven Smith
Domain-Driven Design with ASP.NET MVCDomain-Driven Design with ASP.NET MVC
Domain-Driven Design with ASP.NET MVC
Steven Smith20.6K views
Implementing DDD with C# by Pascal Laurin
Implementing DDD with C#Implementing DDD with C#
Implementing DDD with C#
Pascal Laurin36.3K views
ASP.NET MVC Presentation by ivpol
ASP.NET MVC PresentationASP.NET MVC Presentation
ASP.NET MVC Presentation
ivpol23.6K views
Introduction to ASP.NET MVC by Khaled Musaied
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
Khaled Musaied13.7K views

Similar to Using nu get the way you should svcc

Chef Conf 2015: Package Management & Chef by
Chef Conf 2015: Package Management & ChefChef Conf 2015: Package Management & Chef
Chef Conf 2015: Package Management & Chefice799
1.5K views88 slides
Package manages and Puppet - PuppetConf 2015 by
Package manages and Puppet - PuppetConf 2015Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015ice799
984 views104 slides
Puppet Camp LA 2/19/2015 by
Puppet Camp LA 2/19/2015Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015ice799
866 views87 slides
Que nos espera a los ALM Dudes para el 2013? by
Que nos espera a los ALM Dudes para el 2013?Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?Bruno Capuano
1.9K views93 slides
Fluo CICD OpenStack Summit by
Fluo CICD OpenStack SummitFluo CICD OpenStack Summit
Fluo CICD OpenStack SummitMiguel Zuniga
1.1K views29 slides
Controlling Component Chaos with NuGet and Versioning by
Controlling Component Chaos with NuGet and VersioningControlling Component Chaos with NuGet and Versioning
Controlling Component Chaos with NuGet and VersioningPerforce
1.6K views30 slides

Similar to Using nu get the way you should svcc(20)

Chef Conf 2015: Package Management & Chef by ice799
Chef Conf 2015: Package Management & ChefChef Conf 2015: Package Management & Chef
Chef Conf 2015: Package Management & Chef
ice7991.5K views
Package manages and Puppet - PuppetConf 2015 by ice799
Package manages and Puppet - PuppetConf 2015Package manages and Puppet - PuppetConf 2015
Package manages and Puppet - PuppetConf 2015
ice799984 views
Puppet Camp LA 2/19/2015 by ice799
Puppet Camp LA 2/19/2015Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015
ice799866 views
Que nos espera a los ALM Dudes para el 2013? by Bruno Capuano
Que nos espera a los ALM Dudes para el 2013?Que nos espera a los ALM Dudes para el 2013?
Que nos espera a los ALM Dudes para el 2013?
Bruno Capuano1.9K views
Fluo CICD OpenStack Summit by Miguel Zuniga
Fluo CICD OpenStack SummitFluo CICD OpenStack Summit
Fluo CICD OpenStack Summit
Miguel Zuniga1.1K views
Controlling Component Chaos with NuGet and Versioning by Perforce
Controlling Component Chaos with NuGet and VersioningControlling Component Chaos with NuGet and Versioning
Controlling Component Chaos with NuGet and Versioning
Perforce1.6K views
NuGet (anti-)patterns - Tales from the Trenches by Xavier Decoster
NuGet (anti-)patterns - Tales from the TrenchesNuGet (anti-)patterns - Tales from the Trenches
NuGet (anti-)patterns - Tales from the Trenches
Xavier Decoster2K views
Smarter deployments with octopus deploy by Thibaud Gravrand
Smarter deployments with octopus deploySmarter deployments with octopus deploy
Smarter deployments with octopus deploy
Thibaud Gravrand1.7K views
The Art and Zen of Managing Nagios With Puppet by Mike Merideth
The Art and Zen of Managing Nagios With PuppetThe Art and Zen of Managing Nagios With Puppet
The Art and Zen of Managing Nagios With Puppet
Mike Merideth691 views
O365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf by NCCOMMS
O365Con19 - Sharing Code Efficiently in your Organisation - Elio StruyfO365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf
O365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf
NCCOMMS87 views
Artifacts management with DevOps by Chen-Tien Tsai
Artifacts management with DevOpsArtifacts management with DevOps
Artifacts management with DevOps
Chen-Tien Tsai2.4K views
The Art & Zen of Managing Nagios with Puppet by VictorOps
The Art & Zen of Managing Nagios with PuppetThe Art & Zen of Managing Nagios with Puppet
The Art & Zen of Managing Nagios with Puppet
VictorOps456 views
.Net OSS Ci & CD with Jenkins - JUC ISRAEL 2013 by Tikal Knowledge
.Net OSS Ci & CD with Jenkins - JUC ISRAEL 2013 .Net OSS Ci & CD with Jenkins - JUC ISRAEL 2013
.Net OSS Ci & CD with Jenkins - JUC ISRAEL 2013
Tikal Knowledge2.5K views
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench by Howard Greenberg
August Webinar - Water Cooler Talks: A Look into a Developer's WorkbenchAugust Webinar - Water Cooler Talks: A Look into a Developer's Workbench
August Webinar - Water Cooler Talks: A Look into a Developer's Workbench
Howard Greenberg220 views
Deploying software at Scale by Kris Buytaert
Deploying software at ScaleDeploying software at Scale
Deploying software at Scale
Kris Buytaert2.5K views
Magento 2 Workflows by Ryan Street
Magento 2 WorkflowsMagento 2 Workflows
Magento 2 Workflows
Ryan Street4.7K views
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1) by Ahmed El-Arabawy
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Ahmed El-Arabawy862 views
Effectively using Open Source with conda by Travis Oliphant
Effectively using Open Source with condaEffectively using Open Source with conda
Effectively using Open Source with conda
Travis Oliphant6.3K views
Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe by AppDynamics
Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit EuropeAutomation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe
Automation: The Good, The Bad and The Ugly with DevOpsGuys - AppD Summit Europe
AppDynamics1.6K views
DevOpsGuys - DevOps Automation - The Good, The Bad and The Ugly by DevOpsGroup
DevOpsGuys - DevOps Automation - The Good, The Bad and The UglyDevOpsGuys - DevOps Automation - The Good, The Bad and The Ugly
DevOpsGuys - DevOps Automation - The Good, The Bad and The Ugly
DevOpsGroup997 views

More from Maarten Balliauw

Nerd sniping myself into a rabbit hole... Streaming online audio to a Sonos s... by
Nerd sniping myself into a rabbit hole... Streaming online audio to a Sonos s...Nerd sniping myself into a rabbit hole... Streaming online audio to a Sonos s...
Nerd sniping myself into a rabbit hole... Streaming online audio to a Sonos s...Maarten Balliauw
360 views64 slides
Building a friendly .NET SDK to connect to Space by
Building a friendly .NET SDK to connect to SpaceBuilding a friendly .NET SDK to connect to Space
Building a friendly .NET SDK to connect to SpaceMaarten Balliauw
182 views47 slides
Microservices for building an IDE - The innards of JetBrains Rider - NDC Oslo... by
Microservices for building an IDE - The innards of JetBrains Rider - NDC Oslo...Microservices for building an IDE - The innards of JetBrains Rider - NDC Oslo...
Microservices for building an IDE - The innards of JetBrains Rider - NDC Oslo...Maarten Balliauw
406 views52 slides
Indexing and searching NuGet.org with Azure Functions and Search - .NET fwday... by
Indexing and searching NuGet.org with Azure Functions and Search - .NET fwday...Indexing and searching NuGet.org with Azure Functions and Search - .NET fwday...
Indexing and searching NuGet.org with Azure Functions and Search - .NET fwday...Maarten Balliauw
180 views32 slides
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain... by
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...Maarten Balliauw
326 views53 slides
JetBrains Australia 2019 - Exploring .NET’s memory management – a trip down m... by
JetBrains Australia 2019 - Exploring .NET’s memory management – a trip down m...JetBrains Australia 2019 - Exploring .NET’s memory management – a trip down m...
JetBrains Australia 2019 - Exploring .NET’s memory management – a trip down m...Maarten Balliauw
280 views42 slides

More from Maarten Balliauw(20)

Nerd sniping myself into a rabbit hole... Streaming online audio to a Sonos s... by Maarten Balliauw
Nerd sniping myself into a rabbit hole... Streaming online audio to a Sonos s...Nerd sniping myself into a rabbit hole... Streaming online audio to a Sonos s...
Nerd sniping myself into a rabbit hole... Streaming online audio to a Sonos s...
Maarten Balliauw360 views
Building a friendly .NET SDK to connect to Space by Maarten Balliauw
Building a friendly .NET SDK to connect to SpaceBuilding a friendly .NET SDK to connect to Space
Building a friendly .NET SDK to connect to Space
Maarten Balliauw182 views
Microservices for building an IDE - The innards of JetBrains Rider - NDC Oslo... by Maarten Balliauw
Microservices for building an IDE - The innards of JetBrains Rider - NDC Oslo...Microservices for building an IDE - The innards of JetBrains Rider - NDC Oslo...
Microservices for building an IDE - The innards of JetBrains Rider - NDC Oslo...
Maarten Balliauw406 views
Indexing and searching NuGet.org with Azure Functions and Search - .NET fwday... by Maarten Balliauw
Indexing and searching NuGet.org with Azure Functions and Search - .NET fwday...Indexing and searching NuGet.org with Azure Functions and Search - .NET fwday...
Indexing and searching NuGet.org with Azure Functions and Search - .NET fwday...
Maarten Balliauw180 views
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain... by Maarten Balliauw
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
NDC Sydney 2019 - Microservices for building an IDE – The innards of JetBrain...
Maarten Balliauw326 views
JetBrains Australia 2019 - Exploring .NET’s memory management – a trip down m... by Maarten Balliauw
JetBrains Australia 2019 - Exploring .NET’s memory management – a trip down m...JetBrains Australia 2019 - Exploring .NET’s memory management – a trip down m...
JetBrains Australia 2019 - Exploring .NET’s memory management – a trip down m...
Maarten Balliauw280 views
.NET Conf 2019 - Indexing and searching NuGet.org with Azure Functions and Se... by Maarten Balliauw
.NET Conf 2019 - Indexing and searching NuGet.org with Azure Functions and Se....NET Conf 2019 - Indexing and searching NuGet.org with Azure Functions and Se...
.NET Conf 2019 - Indexing and searching NuGet.org with Azure Functions and Se...
Maarten Balliauw290 views
CloudBurst 2019 - Indexing and searching NuGet.org with Azure Functions and S... by Maarten Balliauw
CloudBurst 2019 - Indexing and searching NuGet.org with Azure Functions and S...CloudBurst 2019 - Indexing and searching NuGet.org with Azure Functions and S...
CloudBurst 2019 - Indexing and searching NuGet.org with Azure Functions and S...
Maarten Balliauw564 views
NDC Oslo 2019 - Indexing and searching NuGet.org with Azure Functions and Search by Maarten Balliauw
NDC Oslo 2019 - Indexing and searching NuGet.org with Azure Functions and SearchNDC Oslo 2019 - Indexing and searching NuGet.org with Azure Functions and Search
NDC Oslo 2019 - Indexing and searching NuGet.org with Azure Functions and Search
Maarten Balliauw958 views
Approaches for application request throttling - Cloud Developer Days Poland by Maarten Balliauw
Approaches for application request throttling - Cloud Developer Days PolandApproaches for application request throttling - Cloud Developer Days Poland
Approaches for application request throttling - Cloud Developer Days Poland
Maarten Balliauw1.1K views
Indexing and searching NuGet.org with Azure Functions and Search - Cloud Deve... by Maarten Balliauw
Indexing and searching NuGet.org with Azure Functions and Search - Cloud Deve...Indexing and searching NuGet.org with Azure Functions and Search - Cloud Deve...
Indexing and searching NuGet.org with Azure Functions and Search - Cloud Deve...
Maarten Balliauw1.1K views
Approaches for application request throttling - dotNetCologne by Maarten Balliauw
Approaches for application request throttling - dotNetCologneApproaches for application request throttling - dotNetCologne
Approaches for application request throttling - dotNetCologne
Maarten Balliauw246 views
CodeStock - Exploring .NET memory management - a trip down memory lane by Maarten Balliauw
CodeStock - Exploring .NET memory management - a trip down memory laneCodeStock - Exploring .NET memory management - a trip down memory lane
CodeStock - Exploring .NET memory management - a trip down memory lane
Maarten Balliauw1.9K views
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain... by Maarten Balliauw
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
ConFoo Montreal - Microservices for building an IDE - The innards of JetBrain...
Maarten Balliauw1.2K views
ConFoo Montreal - Approaches for application request throttling by Maarten Balliauw
ConFoo Montreal - Approaches for application request throttlingConFoo Montreal - Approaches for application request throttling
ConFoo Montreal - Approaches for application request throttling
Maarten Balliauw1.2K views
Microservices for building an IDE – The innards of JetBrains Rider - TechDays... by Maarten Balliauw
Microservices for building an IDE – The innards of JetBrains Rider - TechDays...Microservices for building an IDE – The innards of JetBrains Rider - TechDays...
Microservices for building an IDE – The innards of JetBrains Rider - TechDays...
Maarten Balliauw10.5K views
JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory... by Maarten Balliauw
JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...
JetBrains Day Seoul - Exploring .NET’s memory management – a trip down memory...
Maarten Balliauw1.1K views
DotNetFest - Let’s refresh our memory! Memory management in .NET by Maarten Balliauw
DotNetFest - Let’s refresh our memory! Memory management in .NETDotNetFest - Let’s refresh our memory! Memory management in .NET
DotNetFest - Let’s refresh our memory! Memory management in .NET
Maarten Balliauw480 views
VISUG - Approaches for application request throttling by Maarten Balliauw
VISUG - Approaches for application request throttlingVISUG - Approaches for application request throttling
VISUG - Approaches for application request throttling
Maarten Balliauw817 views
What is going on - Application diagnostics on Azure - TechDays Finland by Maarten Balliauw
What is going on - Application diagnostics on Azure - TechDays FinlandWhat is going on - Application diagnostics on Azure - TechDays Finland
What is going on - Application diagnostics on Azure - TechDays Finland
Maarten Balliauw746 views

Recently uploaded

Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ... by
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...ShapeBlue
120 views17 slides
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue by
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueVNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueShapeBlue
207 views54 slides
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti... by
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...ShapeBlue
141 views29 slides
Evaluation of Quality of Experience of ABR Schemes in Gaming Stream by
Evaluation of Quality of Experience of ABR Schemes in Gaming StreamEvaluation of Quality of Experience of ABR Schemes in Gaming Stream
Evaluation of Quality of Experience of ABR Schemes in Gaming StreamAlpen-Adria-Universität
38 views34 slides
Ransomware is Knocking your Door_Final.pdf by
Ransomware is Knocking your Door_Final.pdfRansomware is Knocking your Door_Final.pdf
Ransomware is Knocking your Door_Final.pdfSecurity Bootcamp
98 views46 slides
The Power of Generative AI in Accelerating No Code Adoption.pdf by
The Power of Generative AI in Accelerating No Code Adoption.pdfThe Power of Generative AI in Accelerating No Code Adoption.pdf
The Power of Generative AI in Accelerating No Code Adoption.pdfSaeed Al Dhaheri
39 views18 slides

Recently uploaded(20)

Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ... by ShapeBlue
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
Import Export Virtual Machine for KVM Hypervisor - Ayush Pandey - University ...
ShapeBlue120 views
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue by ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlueVNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
VNF Integration and Support in CloudStack - Wei Zhou - ShapeBlue
ShapeBlue207 views
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti... by ShapeBlue
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
DRaaS using Snapshot copy and destination selection (DRaaS) - Alexandre Matti...
ShapeBlue141 views
The Power of Generative AI in Accelerating No Code Adoption.pdf by Saeed Al Dhaheri
The Power of Generative AI in Accelerating No Code Adoption.pdfThe Power of Generative AI in Accelerating No Code Adoption.pdf
The Power of Generative AI in Accelerating No Code Adoption.pdf
Saeed Al Dhaheri39 views
LLMs in Production: Tooling, Process, and Team Structure by Aggregage
LLMs in Production: Tooling, Process, and Team StructureLLMs in Production: Tooling, Process, and Team Structure
LLMs in Production: Tooling, Process, and Team Structure
Aggregage57 views
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ... by Jasper Oosterveld
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
ESPC 2023 - Protect and Govern your Sensitive Data with Microsoft Purview in ...
Redefining the book supply chain: A glimpse into the future - Tech Forum 2023 by BookNet Canada
Redefining the book supply chain: A glimpse into the future - Tech Forum 2023Redefining the book supply chain: A glimpse into the future - Tech Forum 2023
Redefining the book supply chain: A glimpse into the future - Tech Forum 2023
BookNet Canada44 views
"Package management in monorepos", Zoltan Kochan by Fwdays
"Package management in monorepos", Zoltan Kochan"Package management in monorepos", Zoltan Kochan
"Package management in monorepos", Zoltan Kochan
Fwdays34 views
Optimizing Communication to Optimize Human Behavior - LCBM by Yaman Kumar
Optimizing Communication to Optimize Human Behavior - LCBMOptimizing Communication to Optimize Human Behavior - LCBM
Optimizing Communication to Optimize Human Behavior - LCBM
Yaman Kumar38 views
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT by ShapeBlue
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
ShapeBlue208 views
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading... by The Digital Insurer
Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading...
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue by ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlueCloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
ShapeBlue139 views
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue by ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
ShapeBlue152 views
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda... by ShapeBlue
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
Hypervisor Agnostic DRS in CloudStack - Brief overview & demo - Vishesh Jinda...
ShapeBlue164 views
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online by ShapeBlue
KVM Security Groups Under the Hood - Wido den Hollander - Your.OnlineKVM Security Groups Under the Hood - Wido den Hollander - Your.Online
KVM Security Groups Under the Hood - Wido den Hollander - Your.Online
ShapeBlue225 views

Using nu get the way you should svcc

  • 1. Using NuGet the way you should Maarten Balliauw @maartenballiauw
  • 2. Who am I? • Maarten Balliauw • Antwerp, Belgium • Developer Advocate, JetBrains • Founder, MyGet • AZUG • Focus on web • Big passion: Azure • http://blog.maartenballiauw.be • @maartenballiauw Shameless self promotion: Pro NuGet - http://amzn.to/pronuget2
  • 3. Agenda • NuGet • File | New Project… • The state of NuGet • Every project is a package • Creating packages • Distributing packages • Consuming packages
  • 5. A brief NuGet introduction... • Package management system for .NET • Visual Studio extension, command line, console • Simplifies incorporating 3rd party libraries • Developer focused • Free, open source • Use packages from the official feed • Publish your own packages • Create & use your own feed
  • 6. File | New Project...
  • 7. Demo File | New Project...
  • 8. That was trouble! Dependency hell •Dependencies on NuGet packages •Dependencies on projects •Dependencies on file system layout • Breaking changes in dependencies
  • 9. “Dependencies, also in real life, are trouble. Have you ever had to depend on a plumber showing up?” - Maarten Balliauw
  • 10. Dependencies before NuGet • Projects in solution •Reference in-house projects: • Either the assemblies (typically unversioned / all 1.0.0.0) • Either the actual project / linked files (unversioned by design) •Reference third party assemblies (e.g. JSON.NET)
  • 11. Dependencies with NuGet • Projects in solution •Reference in-house projects: • Either the assemblies (typically unversioned / all 1.0.0.0) • Either the actual project / linked files (unversioned by design) •Reference third party packages (e.g. JSON.NET) • Semantic Versioning to announce breaking changes (happy times as long as package authors respect that)
  • 12. The state of NuGet
  • 13. The state of NuGet Where are we, 3 years in? •We are consumers! • Even quite some overconsumption I dare say… •We sort of know about Semantic Versioning • If the mayor version changes, we’re doomed •Are we producing? • Some are, e.g. OSS and some companies • Did we solve our dependency issues?
  • 14. .NET is late to the party! •Others have been doing package management for decades • Perl (CPAN.org) • Linux (RPM/YUM/APT-GET/...) • PHP (PEAR, Composer) • Node (npm) • Ruby (Gems) •We can learn a great deal from these!
  • 15. What are the others doing? { "name" : "IniTech.Framework.Formatters", "version" : "1.0.0 ", "author" : "Maarten Balliauw", "bugs" : { "url" : "https://github.com/initech/framework-formatters/issues" }, "description" : "Formatters specific to the IniTech organization.", "homepage" : "https://github.com/initech/framework-formatters", "keywords" : [ "framework", "formatters", "initech" ], "license" : "Proprietary", "main" : "index.js", "repository" : { "type" : "git", "url" : "https://github.com/initech/framework-formatters" }, "scripts" : { "test" : "echo "Error: no test specified" && exit 1" }, "dependencies" : { "date-format" : "0.0.2", "format" : "~0.2.1", "moment" : "~2.5.1" } }
  • 16. What are the others doing? What was in that package.json? •Name and version of the project •Dependencies (and version range) of the project • Every project is a package! • It can have dependencies • It can be depended on
  • 17. Every project is a package
  • 18. Supporting componentization • Every project is a package • Clearly identifyable • Proper Semantic Versioning • Every project becomes discoverable • Nice description, release notes, ... • Add it to a private feed so developers can find it •Dependencies (can) stay out of source control •Dependencies are versioned
  • 19. But… NuGet only has packages.config! •Nodejs: packages.json •Composer (PHP): composer.json •NuGet: • packages.config: dependencies • <projectname>.nuspec: package description • NuGet.config: other settings • It’s 2-3 files in our world, but it is all there. • Let’s become producers!
  • 21. All we need is one file <projectname>.nuspec • XML file which can be generated • nuget.exe spec • Install-Package NuSpec && Install-Nuspec •Run nuget.exe pack to create package
  • 23. Think about versioning! Enforce Explicit Semantic Versioning • www.semver.org Major Breaking changes Minor Backwards compatible changes e.g. API additions Patch Bugfixes not affecting the API • SemVer states intentions • It’s the only way to avoid dependency versioning hell. But not bullet-proof. <dependency id="ExamplePackage" version="1.3.2" /> 1.0 = 1.0 ≤ x (,1.0] = x ≤ 1.0 (,1.0) = x < 1.0 [1.0] = x == 1.0 (1.0) = invalid (1.0,) = 1.0 < x (1.0,2.0) = 1.0 < x < 2.0 [1.0,2.0] = 1.0 ≤ x ≤ 2.0 empty = latest version
  • 25. Which medium? We will need a “package source” or feed • In source control (please don’t) • Local / network folder (slow > ~50 packages) • NuGet.Server (slow > ~50 packages) • NuGet Gallery (clone of www.nuget.org) • MyGet (www.myget.org, SaaS) • ProGet (www.inedo.com/proget) • TeamCity NuGet artifacts (www.jetbrains.com/teamcity) • Sonatype (www.sonatype.com/nexus) • Artifactory (www.jfrog.com)
  • 26. How do they get there? •Manual upload • As part of our continuous integration process • All benefits of CI (e.g. testing) • Plus reporting on which packages we are using • Plus publishing packages for consumption
  • 27. Demo Continuous Integration & Distributing Packages with TeamCity
  • 28. What did we just see? •Creating packages using .nuspec •NuGet configuration inheritance •Continuous Integration on TeamCity • How to run package restore • How to build a package • How to see packages that are being used •How to consume a package
  • 29. NuGet configuration inheritance •Make settings common to projects! • NuGet walks up the directory tree to find NuGet.config files • Or even push them to developer machines • %AppData%NuGetNuGet.config • %ProgramData%NuGetConfig*.config • ... •See http://bit.ly/nuget-config-inheritance • Configure feeds, proxy, credentials, ...
  • 30. More recommendations… • Don’t just update blindly • Not everyone respects SemVer… • It would take us back to the original problem • Don’t autoupdate during builds • Continuous Integration: Same Input = Same Output • Be explicit about versioning
  • 31. Deploying from NuGet packages •Using a simple, handcrafted script • Using a tool like OctopusDeploy.com • Which is even cooler combined with Chocolatey.org •TeamCity supports various ways of deploying (e.g. WebDeploy)
  • 32. Demo Deploying packaged applications with a handcrafted script
  • 33. Considerations •TeamCity internal NuGet feed • Only build artifacts • No way to add external packages that are being used • May not be a problem for your setup • But maybe it is: a feed is much like source control for dependencies • Add dependencies that are being used, NuGet.org, component vendors, ... • If it is, create your own feed, e.g. MyGet.org
  • 34. Create a package source / feed For your team or the entire organization • That’s a cool library! And that one too! • Avoid overconsumption by limiting packages • May not block developers but at least the build will fail • Your own feed will only contain packages you know • Keep versions under control • Keep licensing under control • Easy way to audit external packages in use
  • 35. Demo Pushing packages from TeamCity
  • 36. But I’m using NuGet. It’s broken!!! http://blog.nuget.org/20141010/nuget-is-broken. html • Tied to Visual Studio •Merging sucks (XML merge, yuck!) •Updating fails often • Disk space pollution • Project re-targeting •Pessimistic package version picker / fixed versions
  • 37. Demo ASP.NET vNext approach is the way forward!
  • 39. Conclusions What have we learned? • NuGet • File | New Project… • The state of NuGet • Every project is a package • Creating packages • Distributing packages • Consuming packages
  • 40. “Project references must die. Embrace NuGet by consuming and creating packages. It’s a logical evolution.” - Maarten Balliauw
  • 41. Thank you! http://blog.maartenballiauw.be @maartenballiauw http://amzn.to/pronuget2

Editor's Notes

  1. Maarten
  2. Open IniTech.TpsReports solution Explain demo application we will be building Explain we will skip the actual File | New Project... Because of demo purposes, but we will cover the steps right after that Go through HomeController and the related views and model classes Let’s add some NuGet Goodness! Bootstrap Datepicker ELMAH for diagnostics Run updates! We are get-latest addicts! Next, explain that for date formatting, we need one of our own projects. Which is located somewhere on my disk in another github repository from the framework code team enterprise architects. Open TpsReportCoversheet.cshtml and add reference That is awesome! Build, run and demonstrate the application. Switch hats: become the architect and open IniTech.Framework solution A good architect refactors! Let’s switch namespaces. And that formatter,we need a FormatterFactory for that! Close Visual Studio. We also want to move this project in the source repository, because it is not at the best location Switch hats again and try compiling IniTech.TpsReports solution... What has happened! RELEASE IS TODAY! HELP! And the architect guy is in a meeting or presenting or something. PANIC!
  3. Open IniTech.Framework solution Run a nuget spec and show the file in action (update it and so on) Run nuget pack to package it Open it in NuGet Package Explorer (explain the tool!) and see what is in there Level up: add a dependency on Newtonsoft.Json and run nuget pack again Open in NPE again and see the dependency magically appeared! If you do not want this, add developmentDependency=“true” Open the IniTech.TpsReports solution Drop the project reference and add a package source, install the framework that way Explain how it all works and where packages can come from, folder (and NuGet.Server) are a bad idea! (BAD BAD BAD!) Now that we are here... Create a spec, run packaging on the .csproj Explore the package: dependencies are there, contents are in there too
  4. Explain TeamCity (CI, project, configuration, build steps) Let’s make sure our IniTech.Framework is packaged Create project from URL - https://github.com/maartenba-demo/initech-nuget.git Autodetected build steps: none in this case? Add build step: package restore Solution file: src/framework/IniTech.Framework/IniTech.Framework.sln Restore mode: restore Explain other options and their evilness (autoupdate? noooo!) Mention because of the private feed we are using (TeamCIty itself), we want to add authentication there as well Add build step: build solution Solution file: src/framework/IniTech.Framework/IniTech.Framework.sln Add build step: pack Project file: src/framework/IniTech.Framework/IniTech.Framework/IniTech.Framework.csproj Version: 1.0.%build.number% Output: “artifacts” + tick publish to artifacts to make the package visible on the TeamCity NuGet feed Run a build, see package has been created. Run a NuGet.exe list nuget list -Source http://teamcity.balliauw.net/httpAuth/app/nuget/v1/FeedService.svc Sources: %teamcity.nuget.feed.auth.server% and https://nuget.org/api/v2 Switch to the existing build configuration for the IniTech.TpsReports solution Explain same setup: package restore, build, pack Edit the package restore step and mention for this configuration we are using the TeamCity server itself as a package source, as well as NuGet.org Run a build, see the results tabs and get an inventory of all packages consumed Open IniTech.Framework solution, make a change, commit, build Open the IniTech.TpsReports solution, update packages, keep working Explain that when the framework would have a breaking change, we have to update the version number so developers will see there are breaking changes and they will have work to do when they update for the update. How do developers know about the feeds to use? Open the NuGet.config file, mention inheritance, mention developers will automatically have that feed available Package restore: close the solution, delete the packages folder, open and build Explain no need to use the Enable package restore menu anymore (in fact, it will hurt you) If package restore fails (which happens a lot when fiddling with settings), make sure the (Aggregate Source) is selected in the NuGet.config file so ALL feeds are checked, not just one
  5. Similar to consuming packages in Visual Studio, only command line this time Do a nuget list -Source http://teamcity.balliauw.net/httpAuth/app/nuget/v1/FeedService.svc Explain we can get all packages, install them, ... We know this is a web application, so let us create a deploy.bat Open the existing one Explain the steps in there Explain we are installing without version number in paths so we can more easily script something Feel free to add database deployment in a similar way, calling into SQL Server command line Feel free to add DevOps stuff: why not create a new Windows Azure VM using th CLI tools they have and then FTP the NuGet contents up there? Mention this is quite archaic but it works. You have to know the project you will be deploying and that is it. Mention we could also run this script from TeamCity, in fact we have a demo on that Show the configuration there Show the snapshot dependency Show promoting build Mention OctopusDeploy.com again, show it on screen quickly, explain it is a good companion to TeamCity: Build on one, convention-based deployments with the other
  6. Explain setup: instead of using the TeamCity internal feed we want to use another one The reason for that is: we don’t want to have just our build artifacts on there, but we want to make it the only feed of thruth (much like a VCS does for sources, this feed will do so for dependencies) Quickly create a feed on MyGet, add dependencies from the IniTech.TpsReports solution by uploading packages.config. Make sure they are mirrored. Also configure the framework build to push there and run it. Delete package sources in the IniTech.TpsReports solution and add our one source of thruth All developers can now only use these approved packages + in-house artifacts that are created Option: create an “unstable” feed to test out new versions and migrate to teh “real” feed when they get approved (there is a push upstream feature for that on MyGet)
  7. Show referencing projects kpm build