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 add package --help
  • dotnet add <project_file_path> package <nuget_package_name>
  1. Proje Paket İşlemleri Komutları

dotnet add package

dotnet add package --help

eg@debian:~$ dotnet add package --help
Description:
  Add a NuGet package reference to the project.

Usage:
  dotnet add [<PROJECT>] package <PACKAGE_NAME> [options]

Arguments:
  <PROJECT>       The project file to operate on. If a file is not specified, the command will search the current directory for one. [default: /home/eg/]
  <PACKAGE_NAME>  The package reference to add.

Options:
  -v, --version <VERSION>            The version of the package to add.
  -f, --framework <FRAMEWORK>        Add the reference only when targeting a specific framework.
  -n, --no-restore                   Add the reference without performing restore preview and compatibility check.
  -s, --source <SOURCE>              The NuGet package source to use during the restore.
  --package-directory <PACKAGE_DIR>  The directory to restore packages to.
  --interactive                      Allows the command to stop and wait for user input or action (for example to complete authentication).
  --prerelease                       Allows prerelease packages to be installed.
  -?, -h, --help                     Show command line help.

dotnet add <project_file_path> package <nuget_package_name>

eg@debian:~$ dotnet add ./Data/DotnetCliExamples/ExampleSolution/ExampleSolution.WebApi1/ExampleSolution.WebApi1.csproj package Microsoft.EntityFrameworkCore
  Determining projects to restore...
  Writing /tmp/tmpqydMfj.tmp
info : X.509 certificate chain validation will use the fallback certificate bundle at '/home/eg/.dotnet/sdk/7.0.306/trustedroots/codesignctl.pem'.
info : X.509 certificate chain validation will use the fallback certificate bundle at '/home/eg/.dotnet/sdk/7.0.306/trustedroots/timestampctl.pem'.
info : Adding PackageReference for package 'Microsoft.EntityFrameworkCore' into project './Data/DotnetCliExamples/ExampleSolution/ExampleSolution.WebApi1/ExampleSolution.WebApi1.csproj'.
info :   GET https://api.nuget.org/v3/registration5-gz-semver2/microsoft.entityframeworkcore/index.json
info :   OK https://api.nuget.org/v3/registration5-gz-semver2/microsoft.entityframeworkcore/index.json 582ms
info :   GET https://api.nuget.org/v3/registration5-gz-semver2/microsoft.entityframeworkcore/page/0.0.1-alpha/3.1.3.json
info :   OK https://api.nuget.org/v3/registration5-gz-semver2/microsoft.entityframeworkcore/page/0.0.1-alpha/3.1.3.json 183ms
info :   GET https://api.nuget.org/v3/registration5-gz-semver2/microsoft.entityframeworkcore/page/3.1.4/6.0.0-preview.7.21378.4.json
info :   OK https://api.nuget.org/v3/registration5-gz-semver2/microsoft.entityframeworkcore/page/3.1.4/6.0.0-preview.7.21378.4.json 616ms
info :   GET https://api.nuget.org/v3/registration5-gz-semver2/microsoft.entityframeworkcore/page/6.0.0-rc.1.21452.10/8.0.0-preview.7.23375.4.json
info :   OK https://api.nuget.org/v3/registration5-gz-semver2/microsoft.entityframeworkcore/page/6.0.0-rc.1.21452.10/8.0.0-preview.7.23375.4.json 582ms
info : Restoring packages for /home/eg/Data/DotnetCliExamples/ExampleSolution/ExampleSolution.WebApi1/ExampleSolution.WebApi1.csproj...
info : Package 'Microsoft.EntityFrameworkCore' is compatible with all the specified frameworks in project './Data/DotnetCliExamples/ExampleSolution/ExampleSolution.WebApi1/ExampleSolution.WebApi1.csproj'.
info : PackageReference for package 'Microsoft.EntityFrameworkCore' version '7.0.10' added to file '/home/eg/Data/DotnetCliExamples/ExampleSolution/ExampleSolution.WebApi1/ExampleSolution.WebApi1.csproj'.
info : Generating MSBuild file /home/eg/Data/DotnetCliExamples/ExampleSolution/ExampleSolution.WebApi1/obj/ExampleSolution.WebApi1.csproj.nuget.g.props.
info : Generating MSBuild file /home/eg/Data/DotnetCliExamples/ExampleSolution/ExampleSolution.WebApi1/obj/ExampleSolution.WebApi1.csproj.nuget.g.targets.
info : Writing assets file to disk. Path: /home/eg/Data/DotnetCliExamples/ExampleSolution/ExampleSolution.WebApi1/obj/project.assets.json
log  : Restored /home/eg/Data/DotnetCliExamples/ExampleSolution/ExampleSolution.WebApi1/ExampleSolution.WebApi1.csproj (in 73 ms).
PreviousProje Paket İşlemleri KomutlarıNextdotnet remove package

Last updated 1 year ago