Upload
andrei-marukovich
View
83
Download
0
Embed Size (px)
Citation preview
Using NuGet libraries in your application
Andrei MarukovichLunarFrog.comtwitter: @amarukovich
What is NuGet?• Package Gallery with 65,000+ unique packages• Package manager with CLI and VS clients• NuGet libraries
Usage of the NuGet libraries• NuGet tool• Chocolatey• Squirrel• Wyam• Cake• ReSharper• LINQPad• scriptcs
What we are going to discuss• Package anatomy• Package authoring• Consuming packages using NuGet API
Package anatomy• Package is a .zip archive with .nupkg extension
XYZ.nupkg
\lib\net40
\xyz.dll\uwp10.0
\xyz.dll\netstandard13
\xyz.dll\content\toolsxyz.nuspec
Package authoring
Usage scenarios for NuGet API• Dynamically compose an application from NuGet
packages• Install/update an app plugin as a NuGet package
Demo workflow• Prepare package sources • NuGet.org, MyGet.net, local folder, etc.
• Identify a list of packages to install• A list of top level packages, requested by user or application
• Request NuGet to discover dependencies for the targeted packages• Install packages• Install target packages• Recursively install dependencies
• Use packages
Notes• NuGet is composed from more than 30 libraries• Demonstrated workflow uses 9 of this libraries• Top level packages• NuGet.DependencyResolver • NuGet.Protocol.Core.v3
• Sample is based on NuGet 3.5.0-rc1-final• API may change before the release
NuGet API
Recap• Defined package feed and available resources• PackageSource and SourceRepository
• Defined required packages• IProjectDependencyProvider and LibraryDependency
• Discovered dependencies• RemoteDependencyWalker
• Installed packages• PackageExtractor
More information• lunarfrog.com/blog• docs.nuget.org• \API\NuGet API V3