nuget kibbles and bits: learn how to build and publish a nuget package

23
arn How to Build and Publish a NuGet Packa nuget package manager flavor 100% Complete & Balanced Code For Developers Of All Skill Levels

Upload: chris-bohatka

Post on 08-Jan-2017

205 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package

Learn How to Build and Publish a NuGet Package

nugetpackage manager flavor

100% Complete &Balanced Code

For DevelopersOf All Skill Levels

Page 2: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package

Chris Bohatka

@cjb5790

http://chris.bohatka.com

.NET Web Developer

UX

Clean Code

Page 3: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package

• Founded in 1999 in Cleveland, OH • Global leader and pioneer in enabling

authenticated payments, secure transactions and alternative payment brands

TokenizationMobile Solution DesignConsumerAuthentication

AlternativePayments

Page 4: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package

Some Cardinal Customers

Page 5: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package

Available Positions

• Operations Database Specialist• Technical Services Specialist• Production Engineering Specialist• Software Sentry• Software Developer• Boarding Specialist• Product Experience Intern• Marketing Intern• https://www.cardinalcommerce.com/about/careers

Page 6: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package

You get a package manager, and you get a package manager, and you get a package manager…everyone gets a package manager!

Page 7: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package

You get a package manager, and you get a package manager, and you get a package manager…everyone gets a package manager!

Page 8: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package

What is NuGet?

Page 9: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package

Why NuGet?• Convenient

• Built into Visual Studio

• Restore on build

• Don’t enable NuGet Package Restore

• Dependency Management

• DRY (Don’t Repeat Yourself)

Page 10: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package

What can we include in a NuGet package?

Helpers/Utilities

Extensions

API’s

Roslyn Code Analyzers

Components

User Controls

Tag Helpers

Libraries (CSS, JS)

Configurations

Binaries (DLL's)

Page 11: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package

Package Components

.nupsec

Existing Project

+

=.nupkg

Page 12: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package
Page 13: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package

Let’s Create Our First Package…• Install nuget.exe

• Move to C:\nuget

• Add C:\nuget to your PATH

Page 14: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package

NuGet Spec• Navigate to project directory

• Run:

Page 15: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package

NuGetDemo.nuspec

<?xml version="1.0"?><package > <metadata> <id>$id$</id> <version>$version$</version> <title>$title$</title> <authors>$author$</authors> <owners>$author$</owners> <licenseUrl>http://LICENSE_URL_HERE_OR_DELETE_THIS_LINE</licenseUrl> <projectUrl>http://PROJECT_URL_HERE_OR_DELETE_THIS_LINE</projectUrl> <iconUrl>http://ICON_URL_HERE_OR_DELETE_THIS_LINE</iconUrl> <requireLicenseAcceptance>false</requireLicenseAcceptance> <description>$description$</description> <releaseNotes>Summary of changes made in this release of the package.</releaseNotes> <copyright>Copyright 2015</copyright> <tags>Tag1 Tag2</tags> </metadata></package>

Page 16: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package
Page 17: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package

Generating the Package• “nuget pack”

Page 18: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package

NuGet Package Explorer• http://npe.codeplex.com

Page 19: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package

Publish

Page 20: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package

Publish CLI• “nuget push [nupkg] [apiKey]”

Page 21: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package

DEMO

Let’s Write Some Code!(kinda)

Page 22: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package

Resources• http://docs.nuget.org

Page 23: NuGet Kibbles And Bits: Learn How To Build And Publish A NuGet Package

Thank You

@cjb5790