Dotnet CLI Komutları
  • Giriş
  • Genel Komutlar
    • dotnet
    • dotnet help
    • dotnet sdk check
  • Yüklü Proje Şablonları ile Proje Oluşturma Komutları
    • dotnet new sln
    • dotnet new classlib
    • dotnet new console
    • dotnet new web
    • dotnet new mvc
    • dotnet new webapi
    • dotnet new react
    • dotnet new angular
    • dotnet new grpc
    • dotnet new nunit
    • dotnet new xunit
    • dotnet new mstest
    • dotnet new gitignore
    • dotnet new globaljson
  • Proje Şablon İşlemleri için Komutlar
    • dotnet new list
    • dotnet new search
    • dotnet new install
    • dotnet new uninstall
    • dotnet new update
  • Proje Genel İşlemler için Komutlar
    • dotnet build
    • dotnet clean
    • dotnet publish
    • dotnet run
  • Çözüm (Solution) İşlemleri için Komutlar
    • dotnet sln add
    • dotnet sln remove
    • dotnet sln list
  • Proje Paket İşlemleri Komutları
    • dotnet add package
    • dotnet remove package
    • dotnet list package
  • Projeler Arası Referans Tanımlama Komutları
    • dotnet add reference
    • dotnet remove reference
    • dotnet list reference
  • Proje Sertifika Komutları
    • dotnet dev-certs https
  • Proje Test Komutları
    • dotnet test
  • Dotnet Araçları Genel Komutları
    • dotnet tool list
    • dotnet tool run
    • dotnet tool search
    • dotnet tool install
    • dotnet tool uninstall
    • dotnet tool update
  • Dotnet Code Generator Komutları
    • dotnet aspnet-codegenerator area
    • dotnet aspnet-codegenerator controller
    • dotnet aspnet-codegenerator view
  • Entity Framework Core Migrasyon Komutları
    • dotnet ef migrations add
    • dotnet ef migrations bundle
    • dotnet ef migrations list
    • dotnet ef migrations remove
    • dotnet ef migrations script
  • Entity Framework Core Veritabanı Komutları
    • dotnet ef database update
    • dotnet ef database drop
  • Entity Framework Core DbContext Komutları
    • dotnet ef dbcontext info
    • dotnet ef dbcontext list
    • dotnet ef dbcontext optimize
    • dotnet ef dbcontext scaffold
    • dotnet ef dbcontext script
Powered by GitBook
On this page
  • dotnet new globaljson --help
  • dotnet new globaljson --name <globaljson_file_name> --output <output_directory>
  1. Yüklü Proje Şablonları ile Proje Oluşturma Komutları

dotnet new globaljson

Previousdotnet new gitignoreNextProje Şablon İşlemleri için Komutlar

Last updated 1 year ago

Dotnet core framework ile globaljson dosya şablonu ile json uzantılı globaljson dosyası oluşturabiliyoruz. Aşağıda dosya ile ilgili açıklama yer almaktadır. Detaylı bilgi için linke tıklayabilirsiniz.

Şimdi komutumuzu --help opsiyonu irdeleyelim.

dotnet new globaljson --help

Komutu girdiğimizde karşımıza aşağıdaki gibi bir çıktı geliyor. Şimdi kullanacağımız opsiyonlara bakalım. Bunlar name ve output olacak.

--name opsiyonu ile dosyaya verilecek ismi (ismi .gitignore olarak kalmalı),

--output opsiyonu ile dosyanın oluşacağı dizinin yolunu belirleyebiliyoruz.

eg@debian:~$ dotnet new globaljson --help
global.json file
Author: Microsoft
Description: A file for selecting the .NET SDK version.

Usage:
  dotnet new globaljson [options] [template options]

Options:
  -n, --name <name>      The name for the output being created. If no name is specified, the name of the output directory is used.
  -o, --output <output>  Location to place the generated output.
  --dry-run              Displays a summary of what would happen if the given command line were run if it would result in a template creation.
  --force                Forces content to be generated even if it would change existing files.
  --no-update-check      Disables checking for the template package updates when instantiating a template.
  --project <project>    The project that should be used for context evaluation.
  --type <item>          Specifies the template type to instantiate.

Template options:
  --sdk-version <sdk-version>         The version of the .NET SDK to use.
                                      Type: string
  --roll-forward <patch|feature|...>  The roll-forward policy to use when selecting an SDK version.
                                      Type: choice
                                        patch          Uses the specified version. If not found, rolls forward to the latest patch level. If not found, fails. This value is the legacy 
                                      behavior from the earlier versions of the SDK.
                                        feature        Uses the latest patch level for the specified major, minor, and feature band. If not found, rolls forward to the next higher feature 
                                      band within the same major/minor and uses the latest patch level for that feature band. If not found, fails.
                                        minor          Uses the latest patch level for the specified major, minor, and feature band. If not found, rolls forward to the next higher feature 
                                      band within the same major/minor version and uses the latest patch level for that feature band. If not found, rolls forward to the next higher minor 
                                      and feature band within the same major and uses the latest patch level for that feature band. If not found, fails.
                                        major          Uses the latest patch level for the specified major, minor, and feature band. If not found, rolls forward to the next higher feature 
                                      band within the same major/minor version and uses the latest patch level for that feature band. If not found, rolls forward to the next higher minor 
                                      and feature band within the same major and uses the latest patch level for that feature band. If not found, rolls forward to the next higher major, 
                                      minor, and feature band and uses the latest patch level for that feature band. If not found, fails.
                                        latestPatch    Uses the latest installed patch level that matches the requested major, minor, and feature band with a patch level and that is 
                                      greater or equal than the specified value. If not found, fails.
                                        latestFeature  Uses the highest installed feature band and patch level that matches the requested major and minor with a feature band and patch 
                                      level that is greater or equal than the specified value. If not found, fails.
                                        latestMinor    Uses the highest installed minor, feature band, and patch level that matches the requested major with a minor, feature band, and 
                                      patch level that is greater or equal than the specified value. If not found, fails.
                                        latestMajor    Uses the highest installed .NET SDK with a version that is greater or equal than the specified value. If not found, fail.
                                        disable        Doesn't roll forward. Exact match required.

dotnet new globaljson --name <globaljson_file_name> --output <output_directory>

Aşağıdaki çıktıdaki gibi komutu girdiğimizde globaljson.json adında /home/eg/Data/DotnetCliExamples/ExampleSolution dizininde bir globaljson.json dosyası oluşmuş oluyor.

eg@debian:~$ dotnet new globaljson --name global.json --output /home/eg/Data/DotnetCliExamples/ExampleSolution
The template "global.json file" was created successfully.
global.json dosyası, .NET CLI komutlarını çalıştırdığınızda hangi .NET SDK sürümünün kullanıldığını tanımlamanıza olanak tanır. .NET SDK sürümünün seçilmesi, projenin hedef olduğu çalışma zamanı sürümünü belirtmekten bağımsızdır.