dotnet核心的nuget可执行文件在哪里

dotnet核心的nuget可执行文件在哪里

问题描述:

在运行还原命令时,dotnet核心在哪里寻找nuget可执行文件?

Where does dotnet core look for a nuget executable when running restore commands?

  • 是否有单独的可执行文件,还是nuget函数直接内置在cli工具中?
  • 如果我的路径上已经有一个nuget可执行文件,可以配置dotnet来使用它吗?

NuGet不再是为还原操作而运行的可执行文件,它已成为构建工具和dotnet CLI的集成部分.

NuGet is no longer an executable that runs for a restore operation, it has become an integrated part of the build tooling and the dotnet CLI.

NuGet操作已变成在构建过程中运行的MSBuild任务.然后,此任务将根据需要加载一些NuGet库.还有其他一些任务也使用某些NuGet组件-例如Pack目标或用于确定框架兼容性的某些任务(因为NuGet知道哪个net*/netcoreapp*/netstandard*框架"与另一个框架兼容). ).

NuGet operations have been turned into MSBuild tasks which are run during a build. This task would then load some NuGet libraries as needed. There are other tasks that use some NuGet components as well - such as the Pack target or some tasks used to determine framework compatibility (because NuGet knows which net* / netcoreapp* / netstandard* "frameworks" are compatible with another).

dotnet CLI还使用NuGet的某些库函数来执行诸如dotnet add packagedotnet nuget命令之类的命令.

The dotnet CLI also uses some library functions of NuGet to execute commands such as dotnet add package or the dotnet nuget commands.

因此,您将在SDK目录中找到一些与NuGet相关的DLL文件,而不是单个nuget.exe,并且在构建或命令行操作期间使用的各种组件将使用这些功能.

So instead of a single nuget.exe, you will find some NuGet related DLL files inside the SDK's directory and various components used during the build or command line operations will use functionality of these.

这也意味着您无法轻松地用PATH中的任何nuget.exe替换它们.

This also means that you can't easily replace them with any nuget.exe you have on your PATH.