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

查看:153
本文介绍了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.0 \ Common7 \ IDE \ Extensions \ clzwekqw.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.0\Common7\IDE\Extensions\clzwekqw.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程序包,即当前版本的项目页面

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 packages\NuGet.CommandLine.2.8.3\tools, just the .exe

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

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