Developing and distributing NuGet packages | Clyde D'Souza | Skillshare

Developing and distributing NuGet packages

Clyde D'Souza, Full-stack software developer & author

Developing and distributing NuGet packages

Clyde D'Souza, Full-stack software developer & author

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
24 Lessons (1h 2m)
    • 1. Welcome and introduction

      1:39
    • 2. Class roadmap

      1:57
    • 3. Introduction to NuGet

      3:07
    • 4. Class project

      1:57
    • 5. Installing nuget.exe CLI

      3:21
    • 6. Creating a solution and projects

      3:35
    • 7. Writing code and unit tests

      3:12
    • 8. Thinking about consumption

      6:20
    • 9. Milestone #1

      0:33
    • 10. Getting NuGet-pack ready

      1:02
    • 11. Updating the build output path

      1:47
    • 12. Adding a .nuspec file

      4:54
    • 13. Semantic versioning 1.0

      4:11
    • 14. Add a license file

      2:03
    • 15. Using post-build events

      2:42
    • 16. Creating the NuGet package file

      1:04
    • 17. Unpacking the .nupkg file

      4:02
    • 18. Testing the NuGet package locally

      3:29
    • 19. Milestone #2

      0:37
    • 20. Create an account with nuget.org

      1:50
    • 21. Creating an API key

      1:22
    • 22. Publishing the NuGet package

      2:49
    • 23. Recap

      3:12
    • 24. Conclusion

      0:59
  • --
  • Beginner level
  • Intermediate level
  • Advanced level
  • All levels
  • Beg/Int level
  • Int/Adv level

Community Generated

The level is determined by a majority opinion of students who have reviewed this class. The teacher's recommendation is shown until at least 5 student responses are collected.

9

Students

--

Projects

About This Class

NuGet is the Microsoft-supported mechanism for sharing code. It is a definition of how re-usable code is created for .NET projects and bundled into NuGet packages. It is a tool that helps you create a NuGet package. It is a platform where you can publish your NuGet packages to and share it with other developers. It is a package manager that is integrated with Visual Studio which you can use to consume these NuGet packages. How amazing is that!

In this class you will learn how to develop your very own NuGet package and then publish it to nuget.org! Doesn’t that sound exciting? You will learn what is NuGet in more depth, how to align your thinking when taking the NuGet approach and a lot more.

This class is for you if:

  • You’ve consumed NuGet in the past and want to learn how to develop and distribute your own,
  • You’ve not consumed NuGet but want to learn what NuGet is and learn the entire lifecycle right from development to consumption,
  • Or, you don’t want to learn about NuGet specifically but want to learn how to align your thinking while developing an independent unit of code that could potentially be reused, how to manage versioning of your code and a lot more that I would classify as ‘derived knowledge’.

f913405b

 

Prerequisites

  • Basic knowledge of C# (recommended)
  • Basic familiarity with Visual Studio (recommended)

However, if you are hungry to learn, please don’t stop yourself from watching this class.

Software required

SPOILER ALERT! This class is the first in the NuGet series. Follow my teacher profile to stay up-to-date when I post a new class.

Class roadmap

- Welcome

- Developing the NuGet package

  • Introduction to NuGet
  • Class project
  • Installing nuget.exe CLI
  • Creating a solution and projects
  • Writing code and unit tests
  • Thinking about consumption

- Milestone 1

- Packing and testing the NuGet package

  • Getting NuGet pack ready
  • Updating the build output path
  • Add a license file
  • Adding a .nuspec file
  • Semantic versioning 1.0
  • Using post-build events
  • Creating the NuGet package file
  • Unpacking the .nupkg file
  • Testing the NuGet package locally

- Milestone 2

- Publishing the NuGet package

  • Create an account with NuGet
  • Creating an API key
  • Publishing the NuGet package

- Wrap up

  • Recap
  • Conclusion

Do follow my teacher profile to stay up-to-date on classes I post and please share this class with your network. And at the end of this class please do not forget to share your reviews about this class.

Happy learning!

Meet Your Teacher

Teacher Profile Image

Clyde D'Souza

Full-stack software developer & author

Teacher

Hi,

I'm Clyde. I'm a full-stack software developer. I've also published a book titled Mama, Tell Me a Story which is available on these platforms. It's a collection of twelve short bedtime stories that parents will love reading to their kids over and over again.

In my spare time, I like to explore other interests like writing, teaching and I've also created many other projects in my spare time.

Check out my Skillshare classes below and let me know what you think. Happy learning!

See full profile

Class Ratings

Expectations Met?
  • Exceeded!
    0%
  • Yes
    0%
  • Somewhat
    0%
  • Not really
    0%
Reviews Archive

In October 2018, we updated our review system to improve the way we collect feedback. Below are the reviews written before that update.

Your creative journey starts here.

  • Unlimited access to every class
  • Supportive online creative community
  • Learn offline with Skillshare’s app

Why Join Skillshare?

Take award-winning Skillshare Original Classes

Each class has short lessons, hands-on projects

Your membership supports Skillshare teachers

Learn From Anywhere

Take classes on the go with the Skillshare app. Stream or download to watch on the plane, the subway, or wherever you learn best.

phone

Transcripts

1. Welcome and introduction: Hi, everyone. My name is Sled Soza, and in this class we even learned how to develop and distribute negate packages. With Nugget, you can share the court that you have developed with other developers in the form off naked packages. How amazing is that this class is for you if you have consumed to get in the past on one to learn how to develop and distribute your very own nugget package or you have not consumed it in the past but want to learn what is nugget and the entire life cycle off developing? Do consuming Nick it or you don't learn about to get specifically, but I want to learn how do right individual units, Of course, that you would probably want to reuse. It is advisable to have basic familiarity with C shop and using real studio. But if you are hungry to learn, please don't stop yourself at this video. I recommend you practice on your class project while you learn in parallel. So by the end of this class, we would have published under get packages to the Nugget Gallery or the nugget dot org site . Do follow my teacher profile to stay up to date with the latest classes that I posed. Andi, please do share this class with your network on at the end of this class. Please do not forget to share your reviews about this class. Happy learning on looking forward to each everyone off you completing this last? 2. Class roadmap: way start of this class, by familiarizing ourselves, shouldn't get by understanding what you get is and why take the negative approach the next four videos, right from installing the ghetto Dxy to thinking about consumption. Is oil catered towards developing the nugget package? We then jump onto Milestone number one, which is a quick recap video off what we have learned so far and is also a recap off what is yet to come after Milestone one. We then go into the packing and testing section. There we will learn what is required to make a release folder. No, get back ready. We will look at things like adding a license file, adding in respect file and other concepts. Such a semantic version ING Post will evens and updating the bill output path off a project will then go ahead and create in a good package file. We will test, you know, get back and try locally and also unpackaged the nuclear package file and see what it contains. After completing backing and testing, we then go to the milestone Number two video that is again a recap video off what we learn so far after completing milestone number two. Well, then go into the publishing section off this class. In that section, we will create an account with no get. We will create a A B, a key, and we will publish our nugget package to get dot org. And finally, in a quick wrap up section, we will recap what we learned throughout the entire class and we will end this class with the conclusion video. I hope this clarifies the intentions off each and every video in this class on also help you understand the journey we're about to embark on. 3. Introduction to NuGet: before getting into the implementation off developing and distributing a nugget package. Let's talk a bit about Nugget itself on. The first question that we need to answer is what is known it. Nugget is the Microsoft supported mechanism for sharing cold. It's as simple as that. If you have has a developer has some core that you might think will be using for developers . This is how you shared it. But what is new? Get really? Is it? Is it the website Noga dot org? Or is it just an extension division studio or is it some software that you download? It is pretty much all of those to host your to get packages. Negate provides there that site Noga dot org. To consume Newgate packages, you have new good package manager that comes installed with visual studio. And, of course, to create a good packages, you have the nugget e x e cli. That is the come on line in the face available for you to download from the new get dot org website and then the Nugget back Edge itself, which is basically just a zip file with a different extension that contains your combined gore that is a DLL files plus some other files. Now that we know what is nugget lettuce address? Why Nugget? The simple motive off using nugget is for you to be able to share the accord without the developers and get enables this process and makes it easier for you to do so. Now imagine that you have built this awesome calculator with addition, subtraction, multiplication and division methods. What you've written court for these methods to function. Now you know that other developers might also require certain functionality. So instead of them writing their own accord to perform the same function, what you could do is bundle your calculator with these four methods with these four functions into a nugget package and then distributed were nugget dot org. This way, other developers will only need to search your calculator from the new Gadot org site and downloaded and consume Unigate package without having to write court for these calculator matters themselves. Once you created your nickel package, you can not only distributed were no get out org but also on various other public and private blood forms. This picture aptly illustrates the entire process. The source of this picture is Microsoft's new get documentation site, which I have linked on the top right off this picture knife used on a good package in the past, you would have used it from the right side of this picture, which is the consumption side that is installing in a good package into your daughter project. In this class, we will look at the 1st 3 steps, which is developing and testing your nugget package, backing it up and then distributing it onto newgate dot org. 4. Class project: For this class project, you need to develop and distribute a simple nugget package. Nothing too fancy, just something sweet and simple that demonstrates your understanding off the entire process . Breaking down your task into further four simple steps. Your class project would involve number one developing and unit testing your DNA Get package Second, backing the NUGGET package on testing it locally. Number three publishing in a good package to newgate dot org. And number four is sharing the link off. You're in a good package with this class. Each model of this class is designed to guide you through. This entire process is so make sure you practice on the class project while you learn when submitting your glass project. In addition to sharing the link to your nugget package. Also share how toe consume you in a good package. What are the public? A. B I's You have made available Andi in a paragraph, or do also share your expedience off the whole process before we move on? Here are some ideas for your class project you can create in a good package that gives information off planets in our solar system, or maybe a package that calculates the media off different shapes. Or how about in a good package that randomly generates riddles, maybe even a celebrated information red package or an invention Information get package and finally, maybe a nugget package that prince Console messages in different colors based on the logging type, not decisions. Ideas to kick start your thinking process but feel see to develop any other no good package . If you have another idea that is not on this list, I'm really looking forward to you guys. Somebody in your class projects on me trying out the nugget packages that you have created . 5. Installing nuget.exe CLI: to work with no get were require to install a command line interface. And what better than installing new good Dottie XY cli? So that's the command line interface utility that has all the capabilities of Nugget and Do installer. No Gadot Dxy. Let's head over to nugget dot org forward slash downloads This page has a list off all the war Asians off the new Gadot e x e cli, and it is totally recommended that you install the latest stable version, Onda. At the time of recording this video, the latest stable version is a recommended version is 4.9 point three. So let's install version 4.9 point three and after it is installed, let's open this downloaded E x e file in the folder and copy this exit file and then baste it in this folder that f graded in my C drive called Nugget Cli. Now this can be you increase folder anywhere in your system. I have just created this folder in this particular location because that's where all my Softwares are installed in the C drive. Now the next thing that to be required to do is copy the folder where we just, you know, based on nugget Dirty XY and Search for Environment Variables, which should open up a system, properties dialog and then click on the environment. Variables button in the bottom right off this dialogue. Once you click on that search for the variable path, since right there on the screen, you can either doubles like that or click on the edit button. It should open another should open another Dalek box when you click on that, right? So let's add a new environment variable and based in the Nuggets CLI folder. Not the XY, just the folder name writes. The ones want to paste it in that Let's click on OK And another Okay, and another. Okay, right now that we've installed the nugget cli Let's just if we knew God commands are available, right? So let's go to a random, fallen A. Contest this anywhere in your PC and click on an open up command prompt so it type in. CMD showed up in command prompt. Let's type in nuggets help Onda head ender, and this should bring the nugget help output. And as you can see, the in a good version is clearly mentioned. Has 4.9 point three. And, of course, these are the available command, which is just a part of the new get help output. So this clearly indicates that Nugget has been installed successfully. 6. Creating a solution and projects: in this class, we will develop a demo nugget package, which will consist off basic calculator functionality such as addition, subtraction, multiplication and division. Remember, this class is focused on how to create a new get package and distributed rather than focusing on what nugget package to create, even for the class project, I didn't expect to you to develop a fancy no get package. Just something simple that you have developed Unit tested on distributed were Noga dot org is acceptable and will conform that you have understood the entire process to develop a nugget package. Let's head over to visual studio. I'm using Visual Studio Community 2017. Version 15.5 point one. Let's not click on file New. A new project. Microsoft recommends creating a dotted standard class library. Dotnet Standard is the preferred target for Nugget package. Has it provides compatibility with the widest range off consuming presents for the location . Let's based in this location where my Nugget demo will be located for the name. Let's call this online glass demo so this name will match our Nugget package name before finalizing the name off. In a good package, I would recommend heading to negate dot org and searching for the Nugget package name. Once you search for it, you available to see if there are any existing packages of the same Nugget package name. And if that is your probably want to tweak your name a bit. Let's then uncheck the Create Directory for Solution check box as we don't want another folder to be created in our source folder and then let's click on OK Visual Studio will then create a project called Online Class Demo. In our solution, we have an empty class, which we will rename to Calculator. Since our demo nugget for this class is called is just a calculator functionality. On redeeming this, you'll get a prompt click on Yes, because we just reveal automatically rename all the references to calculator from Class one . Now what we'll do is we'll add a unit s project so we'll click on Add New Project and then , from the best option, lets like the unit test project, which is a document friend book. Let's based in the same location, which is the S. R. C. And let's need rename it do online class them or dot test click on OK and viciously has created a basic units project. So now what we have is one dot net standard class library called online class Demo, which is a nugget package on a unit. This project, which we will use to test our calculator, may 3rd so that we we can test all the functionality, offer nugget package and confirm that it works 100%. 7. Writing code and unit tests: our online class. Dimona Get package is gonna be a simple calculator. So for a simple calculator, let's write some cord and write some unit. Best for the basic calculator functionality. Let's start by heading over to visual studio and in the online class Demo project in an in the calculator class. Let's let's add a simple method. Wordless, surviving a simple addition method in arguably the class where it's a simple see shop, My third a static, my third that basically except to barometers and be and returns the addition of NB right? So let's click on Save and then let's build a solution. The solution bills successfully has expected now similar to the addition method. What I've done is I've added the other methods as well. The other functionality, like subtract, multiply and divide, Right. But now what I want to do is under test these matters. So I will add a reference in my unit s project. The reference is to the online class, they're more standard library click on OK, and you see that the only class Dimel deal is that it has a reference Now, What I don't do is you want to add a unit This method in artist class A really, um this to add dist and write some simple core of the unit destined right? So well will use will consume the calculator class and right. An addition. Method and acceptance. Some dummy values, right? Something like to go my three. And now what we lose will desert. Now this is standard unit test cord right will exert if the expected values that is five. The addition of two hundreds five will compare that with the value with the actual value that we would have received once. Once the Calcutta addition method has executed, the real doors will build a solution again. Once it's complete, let's then head over to the test Explorer and you see the addition Method addition Estimate , er is is detected. We'll click on run oil and the addition dissed Motorist bust, which is good now similar to the addition. My third. What I've done is I've gone hidden added simple. You notice may 3rd 4th the other capital to functionally like subtract, multiply and divide as well. Simple, functional, register tested. The methods are working now. After rebuilding the solution, the test Explorer will detect all these new added test methods. And when I click on the run all button, it will run all the unit tests and it should pass. And it is past, which is good. Now I know that my calculator functionality is working. Have unit tested all their methods and we're all good to go. 8. Thinking about consumption: in this video, we will bring our focus to think how are gonna get package will be consumed. And to demonstrate this, let us assume that our addition method was a bit more complex and to achieve what it does required to use a helper method. Right? So this help of my third is that helpful method that is in a in a calculator helper class. The helper folder is where the guard greater help a glass is right. So this becomes the online class them or or helping their space. And we have a simple and helper that basically just takes the values of A and B and returns the addition now to be able to consume the help of my third, I have to make it a public my third, which is in a public glass. And then in my calculator class, I need to make use off the online class. Dem ordered help in in space. Once they use that, I will be able to access calculator, helper class, and then the ad helper static method, and, of course, and passed the A and B value region returns the addition of two methods. Now this also means that a consumer will be able to consume the our helper method. So imagine this test console project to be a consumer. I will be able to use the online class demo dot helper name space, and because of that, I will also be able to use the calculator helper class, which then exposes the help of method. Now we may not want our help of my turds to be exposed to our consumers. To fix this, let's go back to our helper glass and change the X modifier from public to internal. So what cheeses? That this modify a both for our class for the helper class and for the help of method classes, methods, properties that a martyr's internal will be accessible to any core that is in the same assembly. So in this case, the I'd help my third and the calculator helper class will be accessible to any court in the online class demo assembly in which it is written. Now let me build the solution. Using the keyboard shortcuts control shift B, I can see the bill output that two projects have been successfully built on. One has failed in the out Correctional. See that the test console has failed because the calculator helper is inaccessible. This is expected since remarked, we can clear to help a class and the help of my third has internal. If you want to read more about access modifiers and want to understand how changing the accessibility off a particular class or a particular method really effect how your consumers Consumer nugget package you can head over. So this Microsoft Documentation Page on access Modifiers This base provides an explanation and further links toe all the types of access modifiers, including the internal access modifiers that we just used. Now, in the rare cases where you want to, you notice your internal methods or access these internal metals from your other projects in your solution, you wouldn't be able to do so. For instance, if you want to try to add a unity s method for our helper method. If you try to use the online class demo dot helper named space, you can see that it is not available and you get a rarely squiggly line. If I try to un commend the art helper test method that I just just road before you can see that the calculator Helper class has a very squiggly line as well, telling us that the U noticed project cannot actually access the calculator. Help a class Now, Don't worry, we do have a solution. Let's demonstrate this. If I right click on the only class demo project, add a new folder and name it properties and then right click on properties and add a new class really in this class assembly in four. And in this class, let's remove the existing core and paste in these two lines of court there, including the internals visible toe attribute in the assembling for class on in the brackets. We're specifying the assembly name that will have access to our projects. The online class demo projects internal members and since the class internal visible to is in the system lord runtime dot com violas, services, name space. We need to use the using directive now after saving, If I go and rebuild the solution, I can see that all three projects have been successfully. And if I go to my test class, I can on comment the using directive that makes use off the helper. And if I scroll down, I can un come and the help of unit this matter as well. And since the aeration off 10 and two is 12 let me go ahead and make that quick changes. Well, now that I've made this change, I'll build the solution and my test Explorer will detected the new unit. This method taking on rebuild oil should run the death successfully and pass as well. That's in this video. We have seen how to think from a consumer's perspective when you develop your nugget package and we've all seen how to expose our internal members toe. Maybe the unit is project or do any other projects that you may want to exposed to. 9. Milestone #1: congratulations on reaching the first milestone. Let's quickly recap what we've covered so far. We introduced ourselves to nugget on. We spoke about the class project. Then we installed get don t exceed the CLI, which we will use shortly and then finally resorts, um, Gore on the road. Some unit tests for in a good package on in the next few years. We'll have a look at creating in testing the Nugget package locally, and then after that, we will look at publishing the Nugget package to know, get dot org. 10. Getting NuGet-pack ready: Now that we have returned some cord for a ticket package, it's time to think How do back all of this in doing nugget package and how to make our release folder nugget back ready and by making a least folder negate back ready. I mean, ensuring that release folder has the required fights, the license file, the new spec or the Nuggets specification file the DLL file and they're in the right locations and the right folders so that when we run the no get back command, we are able to generate a valid no get package. Fine. And in the next few videos, you will have a look at adding a license, fire, lighting and respect file. We will look at how to copy these files from location to release folder. How do ensure that at the end and file is in the right for structure with look at using post build, even commands and much more to ensure that a release folder is no get back ready 11. Updating the build output path: in this video, we will have a look at updating the bill output path so that we can go from the current structure, which is on the left, off the screen to the structure that is on the right off screen. Right? So we go have current to expected. And essentially what we're doing is we're just adding the library folder under the release folder. We're beating her build output path to make the release folder. No, get back ready. And by this I mean that way, ensuring that the release folder contains the contents defiles the folders in the right places so that when we run a nugget back, commands we were able to generate are no good package locally. To do that, let's head over division studio right liquor project and click on properties on from the Properties window. Let's look on the bill tab now from this window, let's scroll down to find the output section and in the output path. Let's remove net standard 2.0, and add library just after release rights have been backslash release Backslash Life Library. Let's do the same for debug. Remove nets tended to point Owen and library instead of removing that standard 2.0 is because visual studio will automatically and next ended two point. Oh, have you build a solution and release more. And in just a while we'll see that the output has already changed or been released folder and you see that the library folder as is created now and instead that he have the Nets ended 2.0 folder, which then contains the deal file. 12. Adding a .nuspec file: all right. Just like we had in the license file. Now, this time to add the new suspect file. And let's add this file in the solution items folder. So right, click. Add new item on let's type in online class, then modernise back. Click on add and you should have a blank file open now Let me go to the temple. It that I have in my git repository I will drop the link to this template. Don't worry about that. It will be in the class notes. So let me just copy this template file on and basted in my in the studio and let me close this and reopen it against that visual studio two decks that this is XML, and this is basically what it looks like now. The template just had placeholder values. So what I've done is I've just filled it up with the right to buy leaves and fast forward the radio, and this is what the final respect file looks like. Now what I'm going to do is I'm gonna describe I'm going to talk about each and every element in the metadata tile. I'm gonna explain what it is and how you should actually fill it up. The first element is the idea head, and that has to be the unique Nugget package name. Now this element is required. Field Indian Inspect file. The next required element is the abortion time. Now I have a model in this very class on semantic washing, and I talk about it in much more detail, so I will skip talking about it over here. The title is a user friendly name for in a good package, the authors element is another require element, and it specifies a comma separated list off author names the owners element similar to authors, but it is a comma separated list off use earnings. So in this case, learn with Clyde is actually the user name for my account in newgate dot org. The required license acceptance bullion element will deter mine if the users sees on except license dollar box. When installing, you know, get package now, since we added and and my D license to a nugget package in the previous model, we will specify M. I T. Has the value off her license element. The type physical expression is used because am I D is in the SPD X license. Identify a list for the simplicity of this class. I'm demonstrating just a single approach to adding a license file. The icon UAL is very specify the publicly accessible you are for your noggin packages icon . The description element is another choir element in your new spec file and is used to describe water. No get package does. The summary element is similar to your description element, but the contents off the summary is usually shorter than the contents of her description. The release notes element is used to describe what changes are you introducing with this particular version off into get package? The way I use release notes is I describe the change in maybe one or two sentences. Follower by a link to the Release Notes page. The copyright element is a three decks element but is usually off this particular format. The former is the word copyright followed by the copyright symbol, followed by the year in which you first published your Nugget package and then the author's names. The tags element in respect file, although not require, is actually very crucial for the visibility off in a get package. It is a Space de Limited field. Therefore, if you have multiple tags, as is the case in this example, you will separate each day with a space. Now, the dependencies element is very specified. If your nugget package has any dependencies to external nugget packages and each list of dependencies is grouped under the target framework in the case where you're no good package does not have any external dependencies has is in the case of this example, it would look something like this. And if you're no good package does have any external dependencies, you were listed under the group element. This example shows that my no good package has a dependency on Newton software. Jason version 11 point open to And once you publish your in a good package to know, get out. Org You will see that the values that you enter in your newspeak file appear in different locations on your nugget package page on the new get dot org site. 13. Semantic versioning 1.0: in this video, we will have a look at semantic worsening on will try to learn why the understanding off semantic wash inning is gonna be very healthful. Why, when you devil up on when you distribute your own nugget packages in this video will specifically look at semantic Wash Inning 1.0 Convention semantic version 2.0 point zero convention is supported only on no good version. 4.3 point zero in above and visual studio 2017 words in 15.3 and about. Hence, for wide acceptability, it is unwise to use semantic version 1.0 convention semantic version 1.0 convention is off the format major dot minor dot patch on optionally, a hyphen and a suffix. Each component in this format is implemented for different reasons. The major component is implemented. If there is a breaking change, the minor component is incriminated. If you're introducing new features but is still backwards compatible, the patch component is incremental. If there is backwards compatible bug fixes only and you optionally include the hyphen, sir. Fix version only. If you're introducing a pre release version, let's say an alfa or beta or release candidate version. Some examples of the correct usage off semantic version 1.0 convention is on the screen right now. Let's say you're a version 1.0 point zero and you introduce a breaking change. At this point of time, you will only need to increments the major component off your version. The second scenario highlights the case where you introduced new features, but it still backwards compatible. So you go from 1.5 point 21.6 point zero. Now let's say you're still at a version zero face. In those cases you keep in greasing the batch versions. And if you want to introduce at any given point of time, a pre release version, you go from the Worsen hyphen. Maybe Alfa do version. I've been better. The current flow for a pre release version is always hyphen Alfa Toby tha to release Candidate or R C to talk about semantic Pershing in for the debt. This light shows the incorrect usage striked out in red and the cutting worsening ridden. Besides it So, for instance, if I am at 1.1 point two and I introduced a breaking change, therefore I would increments the major component to to. But when I do increment a major component, I need to reset the minor and the patch components off my version as well. So I cannot go from 1.1 point 2 to 2.1 point two. I need to go to 2.0 point zero, Therefore resetting the minor and the patch components. The second scenario shows that I cannot go backwards inversion ing. I have toe only go forwards, so I cannot go from 3.4 point 0 to 3.3 point zero. I have to always go to 3.5 point zero if I'm incriminating the minor component. The third scenario, it's under the 1st 1 But in this case it shows that if I ever been tremendous in the minor component, I have to reset the patch component to zero. And finally the last example where I have initially gone from Breeder Toto and for three, which is incorrect. I need to go from beater to do release candidate 14. Add a license file: order. Let's look at adding a license file. To do that will add the license file at a solution level at the root level. Let's create at this particular level, let's create a new folder and we'll call it solution items. And in this particular folder, let's right. Click, add and add a new item. Let's call the file name, licence dot MD, which is basically marked down. Click on add and you have a blank markdown file. Now when we had a new license file, it is definitely going to be blank on to fill this up. What I've done is have created a sample license file and an AL both dealing in this video What we lose. We just copy this. This license file it's and a mighty license file has a template for this particular demonstration based into a license file on Just change the placeholder text like the year and daughter name. In this case, I'll just portray 19 and my name Clyde the Souza. It does not always have to be an open source license. If you have another type of license that you want to include in your nugget package, it is absolutely fine the steps for including in non SPD, its license file might be a bit different, but for clarity and for ease of understanding, I have shown in this class a more simpler version off adding a license file. Now, for the sake of the demonstration, it is absolutely fine to keep the mighty license. But if you want to learn more about the licenses and the types of licenses out there, you can head over to choose a license dot com and you'll see a bunch off open source licenses. That out there, Deb said, gives you more information about each license is what allows what it does not allow. You click on the more licenses link at the bottom and you'll see a list of licenses with details on each licenses in a very human readable form, and I'm sure this will be useful 15. Using post-build events: Now, the output of the build does have you know the deal file which you want, which is right folder. Right. But what it does not have is the license file and the on nugget specification file. So what blue is to copy these files or below is will add post, build, even, say, Figaro, build events in the properties and you could possible events and edit portable Leavins. What a loser. This copy some off some of the commands here. So what this does it basically say's copy? Right? The source in do the destination, right? And the four slash Y argument just tells you, Teoh, you know, to copy respective Off it is There's just all right if it's already digits over the file and similarly, we have copy over, right? If it exists, probably the source, which is the license file to the destination, which is the again, The license fights of the licence Destination five. Now this is a micro right circuits dynamically populated. And if I click on the microbes button over here, you'll see the list of mine crews and their values Cervical solution directory. And if I search for solution directory, this is where it is. So this is the source of this place, right? So essentially, it is the source folder and the only enclosed, um, under good specification file. And of course, the destination is the entire project directory, which is this one? She have the source folder, then the adornment. Last library. Then you have the bin folder and then you have the conflagration name. So the configuration name is in this case, it is debug where it could be released if I face which this to release from here. And of course, the index participation fight similarly with the license file as well. So I click on OK and I will save this and then ever build the solution. And when? And I noticed when you when it builds a solution, of course it is hiring the DLL file, but it all say is one file copied another file copy, right? So if you look at the output now in debug, it has the license file and the Nuggets specification filed. And of course, the library still has a daily file 16. Creating the NuGet package file: So I just switched to the release version and I've Bill dissolution again. So and Ben Release. I have my license filed and Nuggets specification fired. And then I have the library file, which has all the deal items as well. So now that I'm in this prince structural loser Liz, open up, command prompt and in this particular one and write Read this. Come on, The Red Nugget. What? And then no, since won't back the files into negative package, I will mention back. And then I'll give the name off the negative specification fight, which is online Glass, Dem or Born a speck. And I just hit, enter and in a short while, it bills deep. No good packages were now by default, it creates a package here, right? It is nugget, not Nugget package fight. It's which Only in class. Dimon Door version 1.0 point Oh Dart noted package 17. Unpacking the .nupkg file: Now a package file is basically just a zip file with a different extension. And let's see what is in the Nugget package file by using the Nugget package that we just created, the online class demo dot and you biggie fighter jets created. If I unzip this, it just creates a folder off the same name, and you can see the contents that it has after unzipping. Some other finds would be familiar with is the dot no Specht filed at the Nugget Specification file and the license file, which is just amount down file. You were also the family with the library folder that contains net standard 2.0, folder on in that folder. It has, you know, the deal file, which is basically what we back while we're creating a nugget back baggage. Now the other contains that that exist in this folder, and let's have a look at it from from bottom bottom up. We have something called Has content types, and the type of this document is an XML document. So far right, like an open with North fired plus Plus, I can see the contents of the document, and all the day's is basically just a mapping off the file extensions that allowed to be pushed to nugget package, newgate dot org and the content type of that particular file extension. So it's just a mapping off the extensions, and they are content type. The next thing on the list is a folder called Package. Now this package for legis can consist off metadata that noted dot org uses. So there's a package folder. There's a service following the package folder andan this meta data folder, followed by Core Properties folder on in this folder. Finally, we have a file with the extension be sm BCP and if with, of course, a beard do ideas. And for for this class, of course, you do not need to get into the details of what this is. But if I just open it with no back classless again, you will see that it's a examine structure file with basically some meta data information that is no different that we put in in the Newspeak file, right? It is. It is pretty much the same thing Who the creator is the description the island if fired the version so on and so forth and fight go back to the main folder. And we have the last folder on this list off unknown files in this in this nugget package, behalf underscore R l s and what this is This is basically again an example document that consists off the relationships between between the suspect file and the P s M D C. P file. Right. So what this is is basically just telling the new get packets or the nugget dot org store? Very, very new spec files located and where the door PSM DCP files located and a random idee for each off the off the two fights. This pretty much completes the UN packaging off a nugget package. 18. Testing the NuGet package locally: All right, now, we have used the nugget back Command on generated on negative package locally. Right? And since we have run this command in the bin release folder, the Nugget package has been generated in same fall as well. But let's now look at how to test this nugget package locally. And to do that, what I've done is have created a local folder. What we're trying to do now is create a local nugget feed and have just used this particular fold off mine in which I would put all my negative packages. Right. So it will be easier for me to test my negative packages locally. Right? So I'll copy this particular folder path, come back to visual studio tools. It's like nugget package manager, Select package manager settings and select package sources, and you'll see the list of sources. Now, what you want to do is going to add a new source on you guessed it right. We will add our local computer feed. The folder images created will paste it in here has the source. Right. So now what visual studio will do? Is it will It will pull those packages from that particular folder in visual studio itself , Right? So that is the local folder that we have created. Let's have a look at how toe Add the package into this folder automatically, nor by copy pasting but through the Nugget backer mind itself. Now I'll go back to my command, prompt in this particular location and release been released location. I've no get Back online class. They modernise spec and add another option to this command called Output Directory and specify The local feel folder has the upper directory hidden under and the command will basically generator Nugget package file, but not in the local folder in the airport military itself directly. Now, as you can see in the local field folder, you have the only class demo dot nugget package. Now let's go back to visual studio and have created a console application just to demonstrate. I wouldn't do it will try to add that package. Try to add it in this country application so that we can test our online class demo back it . So let's go to Nugget Package manager and from the packets source. Let's select our local computer feed and, as you can see there three. It feeds over here. Three packages over here click on the online class demo and click on install, and within a few seconds the Children stole right so they can see that it's in the reference list. Now let's use let's consume the online class demos. Let's use online class demo and then just type in a console right line statement and use calculator dot add super consuming. And they get packet right now supplying two para meters safe. And let's run this council application right now. So debug started new instance and they go. The console application runs and we have the output. Seven plus three is 10 so we have confirmed that we are able to consume our package locally . 19. Milestone #2: awesome. Another milestone complete. Let's do a quick recap of what we achieved. After completing milestone number one, we learned how to create what is required to create in a good package. We added the license file Vieirinha spec file. Then we created the new girl packets locally. And then we also unzipped the nugget package on scene and explore the contents off it and the final leave yours tested the nugget package locally. What we still have remaining is to publish our nugget package to newgate dot org. 20. Create an account with nuget.org: great in the ground with Nugget. Let's head over to newgate dot org and click on the sign, but on the top right of the screen and then the signing with Microsoft. Now, at this point in time, if you do not have a Microsoft account, go ahead and create one in the your Microsoft email address and the password and then taken yes to allow Nugget to access your basic information. No, thank you. And then Nugget has directed that you do not have an account with a bit using the Microsoft email address. So what it is asking you is to enter a user name. So let's and they use name and click on the register button, and that's it. That's pretty much creating an account with newgate dot org. I can click on view account settings and viewed information that Nugget has so the email address a profile. Picture the logging account extra. Now if you notice there's a warning symbol next to my using him, and that is because I have not enabled two factor authentication. So to do that, let's go back to the account settings and under log in information logging account. Let's enable two factor authentication. Great, that is done on DSO. Next time you logon lay you sign out of Logan back, it will ask you to verify identity. So we'll send your text message at court on your mobile phone and you basically entered the cord and that the digits off the phone and verify yourself. And and that's how the two factor authentication gets enabled and and now basically verifies your identity. 21. Creating an API key: All right now we need to push under good package to nugget dot org. And to do that, we require an e p a ki Okay, the ski Let's head over to negate dot org and from your profile, drop down on the top, right? Let's click on a P I keys and from this page from the a p a ki space, let's sit on. Create and name are key and I can give any name. I just like to use the package name and the scope has the format off the key name right? Next. Let us select the expires. Let's just keep the default Has days to the maximum and for the scope again, let's keep the default has pushed only and to associate the packages with the key. Since you don't have any packages, the list is absolutely empty. So let's let's hit star so that it basically this keys associated with all the packages. And you know, once you create multiple packages, you can come back here and then and then associate specific packages only. Let's hit the greed, but now and you'll see a message saying that the key is being generated and you know, you just need to copy the key. This will be availability one time. So corporate and keep it in a safe location for you Can, you know, always re come back and regenerate the A B a key. Or you can edit on the condition of the A P A. K as well. So there's these options of a little. 22. Publishing the NuGet package: now that you have tested and get package locally, it's time to publish under good package to newgate dot org. And to do that, let's head over to command from in this particular location. And let's type in some nugget commands to push on a good package so they get Commander. That basted in this command prompt is Nugget Bush, which to publish the online class demo get package, which is what we just created off what we just packed. After that, I have endured the A B I key that we have generated from newgate dot org. Followed by that is a source option, and the source you are. That is the nugget dot org freed. A be freed, a tender, and in just a couple of seconds, it will push or publish a nugget package to know get dot org. The ego got a successful message. And let's was it no Gadot or Gen re fresh the page? And now, if you see in the unlisted packages section, I can see that my baggage is in the list, so they click on that. As you can see, we have our unique I d. We have the title. The description, all the details that were put in the Newspeak file. We have done this page on a final on in class demo negate baggage page. Now, when you publish a nugget package, it goes through a couple of steps. It goes through a workflow, if you may. It starts with being in the pending foundation and indexing stage, so no get validates. Your nugget package in the background mostly checks for viruses, and it does that periodically as well. After that, it will go into a listed stage where the validation is complete. But it is still pending indexing, right? So the indexing still pending an indexing is usually for your package to appear in search results both on look a dot org and in the clients, like in Visual Studio as well. And it finally, maybe it takes about an are from my experience. So after about an are too low to get an email saying that your package is now published, certainly go finally to be published stage where validation and indexing both are complete after you publish in a good package, this is water to look like notice that the warning message is no longer there below the description area, although the status will still show up as listed, which is totally fine 23. Recap: great work on completing all the videos. I totally understand that there were quite a few off them, but I really appreciate you putting the efforts to complete this entire class in this video . Let's recap everything that we've talked about in this entire class. We start felt this class by familiarizing ourselves with Nugget by trying to understand the water no get is and why take the negate approach? We then seen how to install together e x e on to a local computer, which we then mail use off in the later part of the class. After that, we wrote some court on before some unit tests for our negate package. So we created a doctor and standard class library project on In that, we wrote some chord for our online class Dimona get package, which we basically made a calculator with addition, subtraction, multiplication and division methods wide writing code. We also understood how to think from a consumer's point of view on how simple things like an access modifier changes how consumers use our nugget package. We seen how changing the access modifiers from public to internal makes a difference. After we finished writing the court We then looked at how to make our release folder. No, get back Ready. This means ensuring that the bill output also our darkness standard class library project contains the folder Lib L I B, which then contains the Net standard two point off older and in that folder contains a DLL files. We also made sure that the license file on the new suspect file that we added gets pasted into the bill output. We briefly had a look at the Post Bill even commands that copies of files the license Father, the no spec file from the source location. So the Bill output folder And then we also seen an example off a license file, which was the m I T license. And we created the nurse back file on. We talked about it in detail. Off wide is important and wide exists. We also briefly had a look at semantic worsening one point off. After all of this, we then created the new get package locally by using the Nugget back command. We then tested the nugget package locally as well by configuring a local folder. Toby are nugget feel source And since the Nugget package itself is just a zip with another extension. Be unzip the nugget package and seeing what it condense on Towards the very end. We created an account with dot org. We created an A P I key and then we published our DNA get package from a local computer to newgate dot org. We used Deka Minds Nugget push to do the same. 24. Conclusion: awesome. Thank you so much for completing this class. I hope you've enjoyed it. And I hope you've learned a lot. Just a couple of things before we wrap this class up. Number one review and feedback. Let me know what he thought about this class. What is your feedback about this class and help me improve. Next, Follow my teacher profile to stay up to date with the latest classes that I will post in future and also shared this class with your network so that maybe someone who is looking for this content will find this class useful. And finally another reminder regarding a class project. Do not forget to somebody a class project. And along with sharing the link with this class, also right about your experience off this whole process and also how to use your nugget baggage. Thank you so much. And happy learning