Create and Publish own nuget package

Create and Publish own nuget package


First create class library project, here I have created "DemoApp" project.


Generate the initial manifest  


Open a command prompt and navigate to the project folder containing DemoApp.csproj file.

Run the following command: 

nuget spec DemoApp.csproj

By specifying a project, NuGet creates a manifest that matches the name of the project, in this case DemoApp.nuspec. It also include replacement tokens in the manifest.

Open DemoApp.nuspec in a text editor to examine its contents and udpate



Create Package


From a command prompt in the folder containing your .nuspec file, run the command 

nuget pack

NuGet generates a .nupkg file in the form of identifier-version.nupkg, which you'll find in the current folder.



Publish with nuget push


nuget push DemoApp.1.0.0.nupkg APIKey-GetFrom-Nuget-Account -Source https://api.nuget.org/v3/index.json




Hope this will help you and save your time.

Enjoy !!!

:)

No comments:

Post a Comment