dotnet new sln

Proje veya dosya oluşturma şablonlarını kullanırken new argümanını kullanıyoruz. Bu argümandan sonra ise oluşturmak istediğimiz içerik için şablon argümanını belirtiyoruz.

İlk olarak solution (çözüm) dosyası oluşturacağız. Bilindiği üzere dotnet'te oluşturulan projeler bir solution içerisinde yer alır. Oluşturduğumuz bu solution içerisine projeler eklenir.

dotnet new sln --help

Daha önceki bölümlerde olduğu gibi yine kullanacağımız komutu --help opsiyonu ile inceleyelim. Komutu kullandığımızda karşımıza aşağıdaki gibi bir çıktı gelecektir.

Çıktının açıklama kısmında, proje içermeyen boş bir solution dosyası oluşturmak için bu komutu kullanabileceğimiz belirtiliyor.

eg@debian:~$ dotnet new sln --help
Solution File
Author: Microsoft
Description: Create an empty solution containing no projects

Usage:
  dotnet new sln [options] [template options]
  dotnet new solution [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.

Template options:
   (No options)

dotnet new sln --name <solution_name> --output <output_directory>

Şimdi komutu bazı opsiyonlar ile kullanımına bakalım. Solution oluştururken name ve output opsiyonlarını kullanacağız.

--name opsiyonu ile solution'a verilecek ismi,

--output opsiyonu ile solution dosyasının oluşacağı dizinin yolunu belirtiyoruz.

Aşağıdaki komutu kullandığımızda /home/eg/Data/DotnetCliExamples/ExampleSolution dizini içerisinde ExampleSolution isminde bir solution dosyası oluşturmuş olduk.

eg@debian:~$ dotnet new sln --name ExampleSolution --output /home/eg/Data/DotnetCliExamples/ExampleSolution
The template "Solution File" was created successfully.

Last updated