visual-studio 是否有 Visual Studio 环境变量列表?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1460798/
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
Is there a list of Visual Studio environment variables?
提问by Dana Robinson
Possible Duplicate:
Link to all Visual Studio $ variables
Visual Studio has a lot of environment variables like $(TargetFileName) but I can't seem to find a list of all of them on MSDN or via Google.
Visual Studio 有很多环境变量,如 $(TargetFileName),但我似乎无法在 MSDN 或 Google 上找到所有这些变量的列表。
Does such a list exist?
有这样的清单吗?
NOTE: See the top answer for the duplicate question (link above) for a link to a list on MSDN.
注意:有关 MSDN 上列表的链接,请参阅重复问题的顶部答案(上面的链接)。
采纳答案by OregonGhost
In most places where you can use those, there's a "Macros" button or similar, which shows all available macros and the current value of them. For example, go to the PostBuild event editor to find the list.
在大多数可以使用它们的地方,都有一个“宏”按钮或类似按钮,它显示所有可用的宏及其当前值。例如,转到 PostBuild 事件编辑器以查找列表。
Edit: I just checked. There's a list in MSDN.
编辑:我刚刚检查过。MSDN 中有一个列表。
回答by fduff
You can get the list of available environment variables directly within Visual Studio 2010with the following steps:
您可以通过以下步骤直接在 Visual Studio 2010中获取可用环境变量的列表:
- in Visual Studio env, right click on your project
- properties
- configuration properties/ C++/ General
- for ex. go into Additional Include directories
- 'dropdown' Edit
- Macros
- 在 Visual Studio env 中,右键单击您的项目
- 特性
- 配置属性/ C++/一般
- 例如。进入附加包含目录
- '下拉'编辑
- 宏
There you will find a complete list of available macros with their values set according to your settings. This can be very useful when debugging or selecting the right macro for your project settings.
在那里您将找到可用宏的完整列表,它们的值根据您的设置进行设置。这在调试或为您的项目设置选择正确的宏时非常有用。

