dotnet aks api template
1.0.0
قالب dotnet new لإنشاء API ASP.NET Core Web API لـ ASP.NET Core Web API.
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 الخاصة في مصادر الحزمة الخاصة بك والتي تتداخل مع تثبيت القالب من الريبو الرسمي. على سبيل المثال:
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).