Building the NuGet Package from Visual Studio 2017

When you are ready to create the NuGet package, change the build mode to Release and build it again, to make sure there are no errors. Now, right-click on the project in Visual Studio 2017 Solution Explorer, and from the context menu, click on the menu item Pack, as shown in the following screenshot:

This will start the build process and create the NuGet package file (.nupkg) in the binRelease folder of the project. The file name will construct using the PackageId and PackageVersion that we defined in the project metadata, and will generate as <PackageId>.<PackageVersion>.nupkg (in our case, it's Demo.Packt.Kunal.NuGetDemoStandardLibrary.1.0.0-prerelease.nupkg):

Do you know that a NuGet Package file is just a ZIP file with the extension .nupkg? You can rename the .nupkg to .zip and see its package content. Make sure to change it back before uploading it to nuget.org.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.38.117