visual-studio Visual Studio 命令提示符与常规命令提示符?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1125537/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio Command Prompt vs. a regular command prompt?
提问by John Bubriski
When I open a Visual Studio command prompt (for example, opened with menu Start-> Programs-> Microsoft Visual Studio 2008-> Visual Studio Tools-> Visual Studio 2008 Command Prompt), I get:
当我打开 Visual Studio 命令提示符时(例如,使用菜单Start-> Programs-> Microsoft Visual Studio 2008-> Visual Studio Tools-> Visual Studio 2008 Command Prompt打开),我得到:
Setting environment for using Microsoft Visual Studio 2008 x86 tools.
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE>
What kind of tools are available, and what are the most common uses of this command prompt?
有哪些工具可用,该命令提示符最常见的用途是什么?
采纳答案by Simon P Stevens
It basically just sets several of the Visual Studio binary locations into the PATHenvironment variable for that command window instance. This means you can use all the various commands and tools without having to include the full paths.
它基本上只是将几个 Visual Studio 二进制位置设置到该PATH命令窗口实例的环境变量中。这意味着您可以使用所有各种命令和工具,而无需包含完整路径。
There's a partial list of some of the tools available on MSDN in .NET Framework Toolsand Tools (.NET Framework).
MSDN 上的.NET Framework 工具和工具 (.NET Framework) 中有部分可用工具的列表。
回答by MikeD
The Visual Studio command prompt is a convenient way to access the command line tools that ship with the .NET Framework SDKand, if installed the, Windows Platform SDKtools.
Visual Studio 命令提示符是访问.NET Framework SDK附带的命令行工具以及Windows 平台 SDK工具(如果已安装)的便捷方式。
By providing the Visual Studio command prompt, Microsoft allows you to run these tools without requiring your PATH, INCLUDE, LIB and LIBPATH environment variables to contain all the additional paths to the various folders where Visual Studio and the .NET SDK are installed. Instead, these folder references are added on the fly when you start the Visual Studio command prompt allowing you to run the tools.
通过提供 Visual Studio 命令提示符,Microsoft 允许您运行这些工具,而无需您的 PATH、INCLUDE、LIB 和 LIBPATH 环境变量来包含到安装 Visual Studio 和 .NET SDK 的各种文件夹的所有附加路径。相反,当您启动 Visual Studio 命令提示符以允许您运行工具时,这些文件夹引用会即时添加。
For example, if you open a regular command prompt you cannot run xsd.exewithout changing to the directory "C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin". However, in the Visual Studio command prompt you can just type xsd.exe /?, and it works.
例如,如果您打开常规命令提示符,则必须xsd.exe更改目录才能运行"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin"。但是,在 Visual Studio 命令提示符中,您只需键入xsd.exe /?,它就可以工作。
Please see the MSDN article .NET Framework Toolsfor a complete list of the tools provided with Visual Studio 2008 SP1 and details on what they do.
有关 Visual Studio 2008 SP1 提供的工具的完整列表及其功能的详细信息,请参阅 MSDN 文章.NET Framework 工具。
回答by Dimskiy
The article The Visual Studio Command Prompthas a nice explanation:
文章The Visual Studio Command Prompt有一个很好的解释:
Let's look at the "Visual Studio Command Prompt" in more detail.
It appears to just set the path for you and put you in (Ta Da!) the VC directory under Visual Studio. Not even the C# directory and certainly not the VB directory. I guess they assume that anyone who uses this tool is really hard core and programs directly against the hard drive with a magnifying glass and a magnet.
What it actually does is run this DOS command. (In my case.)
%comspec% /k ""C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"" x86
What does vcvarsall.bat do? Well, it sets the target compiler environment so you can compile code for a different processor.
让我们更详细地看一下“Visual Studio 命令提示符”。
它似乎只是为您设置了路径并将您放入(Ta Da!)Visual Studio 下的 VC 目录中。甚至不是 C# 目录,当然也不是 VB 目录。我猜他们假设任何使用这个工具的人都是真正的铁杆,并用放大镜和磁铁直接对硬盘进行编程。
它实际上做的是运行这个 DOS 命令。(就我而言。)
%comspec% /k ""C:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"" x86
vcvarsall.bat 有什么作用?好吧,它设置了目标编译器环境,以便您可以为不同的处理器编译代码。
回答by greektreat
The Visual Studio command prompt has a few tools with it. Some tools are for repairing the install of Visual Studio. One of the tools I love using is for WCF. You type wcftestclientand you get a client to test your WCF services.
Visual Studio 命令提示符带有一些工具。一些工具用于修复 Visual Studio 的安装。我喜欢使用的工具之一是用于WCF。您键入wcftestclient并获得一个客户端来测试您的 WCF 服务。
回答by John Bubriski
One use seems to be to call the XML Class Generator for using XSD schemas for serialization/deserialization:
一种用途似乎是调用 XML 类生成器以使用 XSD 模式进行序列化/反序列化:

