Skip to main content

.NET

This guide covers setting up .NET development with the .NET SDK and NuGet.

Installation

We recommend .NET 8.0 SDK (Long Term Support).

# Using winget
winget install Microsoft.DotNet.SDK.8

# Or using Chocolatey
choco install dotnet-8.0-sdk

Or download the installer from dotnet.microsoft.com/download.

Verify Installation

dotnet --version
dotnet --list-sdks

NuGet

NuGet is the package manager for .NET. It handles dependency management and is integrated into the .NET CLI.

Common dotnet Commands

# Create a new project
dotnet new webapi -n MyApi

# Restore packages
dotnet restore

# Build project
dotnet build

# Run project
dotnet run

# Run tests
dotnet test

# Add a package
dotnet add package Newtonsoft.Json

Set Up NuGet with JFrog

  1. Go to https://p6m.jfrog.io
  2. Login
  3. Navigate to Profile → Set Me Up → NuGet
  4. Click Generate Token and Create Instructions
  5. Follow the instructions to add the NuGet source:
dotnet nuget add source "https://p6m.jfrog.io/artifactory/api/nuget/v3/nuget" \
--name "p6m" \
--username "your-username" \
--password "your-token"