Where is the nuget executable for dotnet core

不打扰是莪最后的温柔 提交于 2020-12-12 11:17:06

问题


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

  • Is there a separate executable, or are the nuget functions built directly into the cli tools?
  • If I already have a nuget executable on my path, can dotnet be configured to use this?

回答1:


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 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).

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

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.

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



来源:https://stackoverflow.com/questions/50408966/where-is-the-nuget-executable-for-dotnet-core

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!