1 00:00:00,000 --> 00:00:04,644 [MUSIC] 2 00:00:04,644 --> 00:00:09,120 Hello, I'm Jeremy, today we'll be learning about NuGet. 3 00:00:09,120 --> 00:00:13,220 No I don't mean the soft yummy goodness inside of a Snickers bar, 4 00:00:13,220 --> 00:00:16,900 NuGet is a package management system for .NET projects. 5 00:00:16,900 --> 00:00:20,310 It's one of the most used Visual Studio extensions. 6 00:00:20,310 --> 00:00:25,460 It's so popular in fact that it now comes pre-installed with Visual Studio. 7 00:00:25,460 --> 00:00:30,230 It's been around since late 2010 and it was born from a collaboration between 8 00:00:30,230 --> 00:00:34,030 developers of Microsoft and folks in the open source community. 9 00:00:35,426 --> 00:00:39,390 If you wanna earn more about its history and how it can be called NuGet 10 00:00:39,390 --> 00:00:42,830 you might want to check out the teacher's notes of this workshop. 11 00:00:42,830 --> 00:00:46,530 Let's start by talking about what a package management system is, 12 00:00:46,530 --> 00:00:49,230 in order to get a good idea of what NuGet is capable of. 13 00:00:50,230 --> 00:00:52,600 Almost all software has dependencies. 14 00:00:52,600 --> 00:00:55,240 This is code that you probably didn't write yourself but 15 00:00:55,240 --> 00:00:57,820 you want to use in your own application. 16 00:00:57,820 --> 00:01:01,730 In fact, nowadays in order to write a software application, we only need to 17 00:01:01,730 --> 00:01:06,000 write a small percentage of the total code the applications need to run. 18 00:01:07,060 --> 00:01:11,330 Our code depends on other code that we probably didn't write ourselves. 19 00:01:11,330 --> 00:01:14,761 In the case of C#, this code is typically compiled and 20 00:01:14,761 --> 00:01:16,859 packaged together as a library. 21 00:01:16,859 --> 00:01:19,515 .Net libraries are called assemblies. 22 00:01:19,515 --> 00:01:22,527 But you'll notice that I use the terms, library and 23 00:01:22,527 --> 00:01:25,894 assembly interchangeably to refer to .NET assemblies. 24 00:01:25,894 --> 00:01:29,116 The libraries our applications need may already be part of 25 00:01:29,116 --> 00:01:31,877 the operating system the application runs on, or 26 00:01:31,877 --> 00:01:36,500 they may be part of another application that is already installed on the computer. 27 00:01:36,500 --> 00:01:37,830 .NET, for example, 28 00:01:37,830 --> 00:01:42,100 is a piece of software that comes pre-installed on Windows computers. 29 00:01:42,100 --> 00:01:46,175 It contains many libraries that are used by .NET applications. 30 00:01:46,175 --> 00:01:51,956 .NET in turn, depends on libraries that are part of the Windows operating system. 31 00:01:51,956 --> 00:01:55,455 We can get other libraries that we might want to use our applications, 32 00:01:55,455 --> 00:01:57,482 by downloading them from the Internet. 33 00:01:57,482 --> 00:02:01,095 This is where package management system comes in. 34 00:02:01,095 --> 00:02:05,255 People and organizations that want to make their code available for 35 00:02:05,255 --> 00:02:07,195 others to use can put one or 36 00:02:07,195 --> 00:02:13,025 more libraries into a package and upload it to a central repository of packages. 37 00:02:13,025 --> 00:02:15,235 When we want to use their libraries, 38 00:02:15,235 --> 00:02:19,380 we only need to go to the central repository and download them. 39 00:02:19,380 --> 00:02:24,380 A Package Management System is responsible for managing all of these packages and 40 00:02:24,380 --> 00:02:29,720 making it easy for developers to both upload and download packages. 41 00:02:29,720 --> 00:02:33,310 We can think of it as an App Store for code where everything is free. 42 00:02:34,360 --> 00:02:37,840 Now you may have noticed that there are many different package management systems 43 00:02:37,840 --> 00:02:41,840 out there, there's typically a main one for each programming language. 44 00:02:41,840 --> 00:02:45,146 So if you're coming to .Net from another programming language, 45 00:02:45,146 --> 00:02:48,286 you may already be familiar with one or more package managers. 46 00:02:48,286 --> 00:02:51,250 For example, Java has Gradle. 47 00:02:51,250 --> 00:02:56,090 Ruby has gems, Python has Pip, JavaScript has NPM and 48 00:02:56,090 --> 00:02:59,800 Bower, PHP has Composer, and the list goes on and on. 49 00:02:59,800 --> 00:03:04,240 The package management system for .NET is Nuget. 50 00:03:04,240 --> 00:03:09,588 When I say .NET, I mean any packages that are meant to run using the .NET framework. 51 00:03:09,588 --> 00:03:12,622 .NET assemblies can be compiled from C# or 52 00:03:12,622 --> 00:03:16,808 any .NET programming language such as J# or Visual Basic. 53 00:03:16,808 --> 00:03:20,812 NuGet packages typically only contain the assembly files and 54 00:03:20,812 --> 00:03:23,048 not the actual source code files. 55 00:03:23,048 --> 00:03:26,846 Now let's open Visual Studio and see what NuGet can do. 56 00:03:26,846 --> 00:03:31,667 For this workshop, you'll want to have Visual Studio 2015 or later installed. 57 00:03:31,667 --> 00:03:35,115 If you don't already have it installed, check the teacher's notes for 58 00:03:35,115 --> 00:03:37,220 a workshop on how to install Visual Studio.