DEV Community

Anil Kumar Khandei
Anil Kumar Khandei

Posted on • Updated on

Generate NuGet Package with Octopus CLI

Prerequisites

  • Visual studio code

Create a simple dotnet mvc web app

  • dotnet command to check latest framework version
    dotnet --version

  • cli command to create a new mvc web app along with version specification when you have multiple dotnet frameworks installed locally and you dont want to use the latest one :)-

dotnet new mvc --language C# --framework net5.0

Installing the octopus cli

  • If you want to install Octopus CLI make sure you install it globally using the command-

dotnet tool install Octopus.DotNet.Cli --global

Build / Run / Publish

  • Command to build project-

dotnet build

  • Command to run project-

dotnet run

Check app is up and running using the link generated on the console

  • Command to publish the project

first ctrl+c to stop running the project
run following command to publish project to custom directory-
dotnet publish -o <foldername>

Generate the Nuget Package

  • Command to generate the nuget package from cli-

dotnet-octo pack --id=CodeWithAnil -outFolder=ArtifactFolder --basePath=Publish

--id=projectname
--outFolder=folder where to create the nuget package
--basePath=folder where you published your webapp or api

Top comments (0)