Visual Studio 在哪里保留它自己的 nuget.exe 副本? [英] Where does Visual Studio keep it's own copy of nuget.exe?

查看:28
本文介绍了Visual Studio 在哪里保留它自己的 nuget.exe 副本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道 Visual Studio 将它的 nuget.exe 副本保存在哪里,以便我可以在我计划执行的自定义 msbuild 目标中使用该路径.

I'd like to know where Visual Studio keeps it's copy of nuget.exe so that I can use that path in a custom msbuild target I'm planning to do.

前段时间,NuGet 包还原在 Visual Studio 中不是自动的:您必须导入自定义 .targets 文件,以便在构建之前还原包.当时,nuget.exe 的副本与每个解决方案一起保存在 .nuget 文件夹中.如今,Visual Studio 在构建时会自动执行此操作,这向我表明某处有一个 nuget.exe 文件,它用于恢复解决方案的包.

Some time ago, NuGet package restore was not automatic in Visual Studio: you had to import a custom .targets file so that packages were restored before building. At the time, a copy of nuget.exe was kept with each solution in a .nuget folder. Nowadays, Visual Studio does this automatically when building, which indicates to me that somewhere there is a nuget.exe file that it uses to restore the packages for the solution.

理想情况下,我想知道它使用 MSBuild 宏的路径,因为那样的话,在哪台机器上构建项目并不重要,路径将始终指向正确的位置.

Ideally I'd like to know it's path using MSBuild macros, because then it would not matter at which machine the projects are being built, the path will always point to the correct place.

对于那些可能好奇的人,我想开始分发我们在私有 nuget 提要上拥有的内部库,并打算在构建时使用 nuget.exe 构建 nupkg 文件.我知道 NuGetter,但它比我想要的更复杂和不灵活,所以我觉得纯粹是 msbuild方法至少从一开始会更简单.

For those who may be curious, I want to start distributing an internal library we have on a privage nuget feed, and intend to build the nupkg files using nuget.exe on build time. I know about NuGetter, but it is a bit more complex and inflexible than I wanted, so I feel a pure msbuild approach would be simpler to start with at least.

推荐答案

我想知道 Visual Studio 将它的 nuget.exe 副本保存在哪里

I'd like to know where Visual Studio keeps it's copy of nuget.exe

它没有.Nuget 是一个加载项,只是 DLL.在我的机器上,它存储在 C:Program Files (x86)Microsoft Visual Studio 12.0Common7IDEExtensionsclzwekqw.krr 目录中.目录名称的clzwekqw.krr"部分不会从一台机器重复到另一台机器,它是动态创建的.一种避免加载项相互干扰的基本机制.

It doesn't have one. Nuget is an add-in, just DLLs. On my machine it is stored in the C:Program Files (x86)Microsoft Visual Studio 12.0Common7IDEExtensionsclzwekqw.krr directory. The "clzwekqw.krr" part of the directory name is not going to repeat from one machine to the next, it was dynamically created. A basic mechanism to avoid having add-ins step on each other's toes.

可以获取Nuget.exe,可以通过Nuget获取:)获取Nuget.CommandLine包,当前版本的项目页面在这里.它将像往常一样安装在项目的子目录中.目前是packagesNuGet.CommandLine.2.8.3 ools,只是.exe

You can get Nuget.exe, it is available through Nuget :) Obtain the Nuget.CommandLine package, the current version's project page is here. It will be installed as usual, in a subdirectory of your project. Currently packagesNuGet.CommandLine.2.8.3 ools, just the .exe

这篇关于Visual Studio 在哪里保留它自己的 nuget.exe 副本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆