dotnet aks api template
1.0.0
เทมเพลต dotnet new สำหรับการสร้าง ASP.NET Core Web API สำหรับ AKS
dotnet new -i RobBell.AksApi.Template
เทมเพลตแก้ไขจากที่เก็บ NuGet อย่างเป็นทางการ
เพื่อสร้างโครงการใหม่ชื่อ MyAPI :
dotnet new aksapi -n MyApi
ตัวเลือกอื่น ๆ รวมถึง:
--controller-name The name of the default controller
Default: SampleController
--disable-open-api Disable OpenAPI (Swagger) support
Default: false
--disable-health-check Disable liveness and readiness support
Default: false
--disable-logging Disable Logging and AppInsights support
Default: false
--instrumentation-key The AppInsights application key if logging is enabled
Default: 11111111-1111-1111-11111111111111111
--skip-restore Skips the restore of the project on create
Default: false
dotnet restore dotnet new การสร้างใหม่ 1: 1 พร้อมที่เก็บหรือไม่? หลังจากทำการเปลี่ยนแปลงเทมเพลตให้เรียกใช้สคริปต์ด้านล่างเพื่อแพ็คและติดตั้งในเครื่อง:
./pack-and-install.sh
เมื่อเสร็จสมบูรณ์คุณสามารถสร้างโครงการใหม่จากเทมเพลตโดยใช้:
dotnet new aksapi
พยายาม:
dotnet new -i RobBell.AksApi.Template --nuget-source https://api.nuget.org/v3/index.json
บางครั้งคุณอาจมีที่เก็บ Nuget ส่วนตัวในแหล่งแพ็คเกจของคุณซึ่งรบกวนการติดตั้งเทมเพลตจาก repo อย่างเป็นทางการ ตัวอย่างเช่น:
C:Program Filesdotnetsdk3.1.403NuGet.targets(128,5):
error : Unable to load the service index for source https://myprivatenugetrepo.com/nuget/v3/index.json.
C:Program Filesdotnetsdk3.1.403NuGet.targets(128,5):
error : Response status code does not indicate success: 401 (Unauthorized).