dotnet slndotnet sln
Bu makale şu şekilde geçerlidir: ✔️ .NET Core 2. x SDK ve sonraki sürümleriThis article applies to: ✔️ .NET Core 2.x SDK and later versions
NameName
dotnet sln
-Bir .NET çözüm dosyasındaki projeleri listeler veya değiştirir.dotnet sln
- Lists or modifies the projects in a .NET solution file.
ÖzetiSynopsis
dotnet sln [<SOLUTION_FILE>] [command]
dotnet sln [command] -h|--help
DescriptionDescription
dotnet sln
Komut, bir çözüm dosyasındaki projeleri listelemek ve değiştirmek için kullanışlı bir yol sağlar.The dotnet sln
command provides a convenient way to list and modify projects in a solution file.
Komutunu kullanmak için dotnet sln
, çözüm dosyası zaten var olmalıdır.To use the dotnet sln
command, the solution file must already exist. Bir tane oluşturmanız gerekiyorsa, aşağıdaki örnekte olduğu gibi DotNet New komutunu kullanın:If you need to create one, use the dotnet new command, as in the following example:
dotnet new sln
ArgumentsArguments
SOLUTION_FILE
Kullanılacak çözüm dosyası.The solution file to use. Bu bağımsız değişken atlanırsa, komut geçerli dizinde bir arar.If this argument is omitted, the command searches the current directory for one. Çözüm dosyası veya birden çok çözüm dosyası bulursa, komut başarısız olur.If it finds no solution file or multiple solution files, the command fails.
SeçeneklerOptions
-h|--help
Komutunun nasıl kullanılacağına ilişkin bir açıklama yazdırır.Prints out a description of how to use the command.
KomutlarCommands
list
Bir çözüm dosyasındaki tüm projeleri listeler.Lists all projects in a solution file.
ÖzetiSynopsis
dotnet sln list [-h|--help]
ArgumentsArguments
SOLUTION_FILE
Kullanılacak çözüm dosyası.The solution file to use. Bu bağımsız değişken atlanırsa, komut geçerli dizinde bir arar.If this argument is omitted, the command searches the current directory for one. Çözüm dosyası veya birden çok çözüm dosyası bulursa, komut başarısız olur.If it finds no solution file or multiple solution files, the command fails.
SeçeneklerOptions
-h|--help
Komutunun nasıl kullanılacağına ilişkin bir açıklama yazdırır.Prints out a description of how to use the command.
add
Çözüm dosyasına bir veya daha fazla proje ekler.Adds one or more projects to the solution file.
ÖzetiSynopsis
dotnet sln [<SOLUTION_FILE>] add [--in-root] [-s|--solution-folder <PATH>] <PROJECT_PATH> [<PROJECT_PATH>...]
dotnet sln add [-h|--help]
ArgumentsArguments
SOLUTION_FILE
Kullanılacak çözüm dosyası.The solution file to use. Belirtilmemişse, komut geçerli dizinde bir arar ve birden çok çözüm dosyası varsa başarısız olur.If it is unspecified, the command searches the current directory for one and fails if there are multiple solution files.
PROJECT_PATH
Çözüme eklenecek projenin veya projelerin yolu.The path to the project or projects to add to the solution. UNIX/Linux kabuğu Glob model genişletmeleri, komut tarafından doğru şekilde işlenir
dotnet sln
.Unix/Linux shell globbing pattern expansions are processed correctly by thedotnet sln
command.
SeçeneklerOptions
-h|--help
Komutunun nasıl kullanılacağına ilişkin bir açıklama yazdırır.Prints out a description of how to use the command.
--in-root
Bir çözüm klasörü oluşturmak yerine, projeleri çözümün köküne koyar.Places the projects in the root of the solution, rather than creating a solution folder. .NET Core 3,0 SDK 'dan beri kullanılabilir.Available since .NET Core 3.0 SDK.
-s|--solution-folder <PATH>
Projelerin ekleneceği hedef çözüm klasörünün yolu.The destination solution folder path to add the projects to. .NET Core 3,0 SDK 'dan beri kullanılabilir.Available since .NET Core 3.0 SDK.
remove
Çözüm dosyasından bir projeyi veya birden çok projeyi kaldırır.Removes a project or multiple projects from the solution file.
ÖzetiSynopsis
dotnet sln [<SOLUTION_FILE>] remove <PROJECT_PATH> [<PROJECT_PATH>...]
dotnet sln [<SOLUTION_FILE>] remove [-h|--help]
ArgumentsArguments
SOLUTION_FILE
Kullanılacak çözüm dosyası.The solution file to use. Belirtilmemişse, komut geçerli dizinde bir arar ve birden çok çözüm dosyası varsa başarısız olur.If is left unspecified, the command searches the current directory for one and fails if there are multiple solution files.
PROJECT_PATH
Çözüme eklenecek projenin veya projelerin yolu.The path to the project or projects to add to the solution. UNIX/Linux kabuğu Glob model genişletmeleri, komut tarafından doğru şekilde işlenir
dotnet sln
.Unix/Linux shell globbing pattern expansions are processed correctly by thedotnet sln
command.
SeçeneklerOptions
-h|--help
Komutunun nasıl kullanılacağına ilişkin bir açıklama yazdırır.Prints out a description of how to use the command.
ÖrneklerExamples
Bir çözümdeki projeleri listeleyin:List the projects in a solution:
dotnet sln todo.sln list
Bir çözüme C# projesi ekleyin:Add a C# project to a solution:
dotnet sln add todo-app/todo-app.csproj
Bir C# projesini çözümden kaldırma:Remove a C# project from a solution:
dotnet sln remove todo-app/todo-app.csproj
Bir çözümün köküne birden çok C# projesi ekleyin:Add multiple C# projects to the root of a solution:
dotnet sln todo.sln add todo-app/todo-app.csproj back-end/back-end.csproj --in-root
Bir çözüme birden çok C# projesi ekleyin:Add multiple C# projects to a solution:
dotnet sln todo.sln add todo-app/todo-app.csproj back-end/back-end.csproj
Bir çözümden birden çok C# projesini kaldırma:Remove multiple C# projects from a solution:
dotnet sln todo.sln remove todo-app/todo-app.csproj back-end/back-end.csproj
Bir glob deseninin (yalnızca Unix/Linux) kullanıldığı bir çözüme birden çok C# projesi ekleme:Add multiple C# projects to a solution using a globbing pattern (Unix/Linux only):
dotnet sln todo.sln add **/*.csproj
Glob deseninin kullanıldığı bir çözüme birden çok C# projesi ekleme (yalnızca Windows PowerShell):Add multiple C# projects to a solution using a globbing pattern (Windows PowerShell only):
dotnet sln todo.sln add (ls -r **/*.csproj)
Bir glob deseninin (yalnızca Unix/Linux) kullanıldığı bir çözümden birden çok C# projesini kaldırma:Remove multiple C# projects from a solution using a globbing pattern (Unix/Linux only):
dotnet sln todo.sln remove **/*.csproj
Glob deseninin kullanıldığı bir çözümden birden çok C# projesini kaldırma (yalnızca Windows PowerShell):Remove multiple C# projects from a solution using a globbing pattern (Windows PowerShell only):
dotnet sln todo.sln remove (ls -r **/*.csproj)
Bir çözüm, konsol uygulaması ve iki sınıf kitaplığı oluşturun.Create a solution, a console app, and two class libraries. Projeleri çözüme ekleyin ve '
--solution-folder
nin seçeneğini kullanarakdotnet sln
sınıf kitaplıklarını bir çözüm klasörü olarak düzenleyin.Add the projects to the solution, and use the--solution-folder
option ofdotnet sln
to organize the class libraries into a solution folder.dotnet new sln -n mysolution dotnet new console -o myapp dotnet new classlib -o mylib1 dotnet new classlib -o mylib2 dotnet sln mysolution.sln add myapp\myapp.csproj dotnet sln mysolution.sln add mylib1\mylib1.csproj --solution-folder mylibs dotnet sln mysolution.sln add mylib2\mylib2.csproj --solution-folder mylibs
Aşağıdaki ekran görüntüsünde, Visual Studio 2019 Çözüm Gezgini sonucu gösterilmektedir:The following screenshot shows the result in Visual Studio 2019 Solution Explorer: