因为很少用, 容易忘记所以记入起来, 方便找
Start, Run, Publish Project
dotnet new webapp -o simple-test (razor page project)
dotnet new web -o simplete-test (empty project)
dotnet dev-certs https --trust (弄一次就可以了)
dotnet watch run
dotnet publish Project.csproj -o C:keatkeatprojects elease (-o 是 output path, csproj 是需要选一个)
add, list package
dotnet add package Azure.Storage.Blobs
dotnet add Project.csproj package Azure.Storage.Blobs (如果是多个 project 的话就要加 ProjectName.csproj)
dotnet list package | dotnet list Project.csproj package
User Secret
dotnet user-secrets init
dotnet user-secrets set "password" "123456" --project "C:appsWebApp1srcWebApp1"
dotnet user-secrets list
dotnet user-secrets remove "password"
dotnet user-secrets clear
Ef core
dotnet tool update dotnet-ef --global
dotnet ef migrations add init -c ApplicationDbContext -o Migrations/App
dotnet ef migrations add adjust68 -c ApplicationDbContext -o Migrations/App
dotnet ef database update -c ApplicationDbContext
dotnet ef migrations remove -c ApplicationDbContext
Azure key-vault and secret
az group create --name "klc-resource-group" --location "SoutheastAsia"
az keyvault create --name "klc-test-key-vault" --resource-group "klc-resource-group" --location "Southeast Asia"
az keyvault secret set --vault-name "klc-test-key-vault" --name "Password" --value "123456"