Skip to content

Latest commit

 

History

History
104 lines (69 loc) · 1.94 KB

DotNet.md

File metadata and controls

104 lines (69 loc) · 1.94 KB

.NET Commands

Solution

Howto create a new solution

dotnet new sln -n [YourSolutionName]

Howto add project to solution

dotnet sln add [yourProjectName]\[yourProjectName].csproj

How to create a new class library project

dotnet new classlib -n [YourProjectName]

How to see installed dotnet sdks

dotnet --list-sdks

How to specify dotnet version with dotnet new

dotnet new web -h
dotnet new web -o MySimpleWebApp --framework|-f net5.0

Howto add reference to other project

dotnet add reference ../../src/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme/Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme.csproj

Packages

Add package to project

dotnet add package [PackageName]

Gitignore

Generate a gitignore file from the command line

dotnet new gitignore

User Secrets

You can find the user secrets in following folder: C:\Users\bartv\AppData\Roaming\Microsoft\UserSecrets

Init

dotnet user-secrets init

List

dotnet user-secrets list

Set a secret

dotnet user-secrets set "AuthorApiKey" "xyz1@3"

Remove a secret

dotnet user-secrets remove "AuthorApiKey"

Remove all secrets

dotnet user-secrets clear

Generates a self-signed certificate to enable HTTPS use in development

The dotnet dev-certs command manages a self-signed certificate to enable HTTPS use in local web app development. Its main functions are:

  • Generating a certificate for use with HTTPS endpoints during development.
  • Trusting the generated certificate on the local machine.
  • Removing the generated certificate from the local machine.
  • Exporting a certificate in various formats so that it can be used by other tools.
  • Importing an existing certificate generated by the tool into the local machine.
    dotnet dev-certs https --verbose --trust