Link to all Visual Studio $ variables

2019-01-08 04:26发布

I was having a look at $(Configuration),$(ProjectDir) etc. in Visual Studio 2008 for Prebuild events.

Is there a link to all of these variables with a definition for each one of them?

5条回答
地球回转人心会变
2楼-- · 2019-01-08 05:00

To add to the other answers, note that property sheets can be configured for the project, creating custom project-specific parameters.

To access or create them navigate to(at least in Visual Studio 2013) View -> Other Windows -> Property Manager. You can also find them in the source folder as .prop files

查看更多
Viruses.
3楼-- · 2019-01-08 05:04

While there does not appear to be one complete list, the following may also be helpful:

How to use Environment properties:
  http://msdn.microsoft.com/en-us/library/ms171459.aspx

MSBuild reserved properties:
  http://msdn.microsoft.com/en-us/library/ms164309.aspx

Well-known item properties (not sure how these are used):
  http://msdn.microsoft.com/en-us/library/ms164313.aspx

查看更多
Animai°情兽
5楼-- · 2019-01-08 05:08

If you need to find values for variables other than those standard VS macros, you could do that easily using Process Explorer. Start it, find the process your Visual Studio instance runs in, right click, Properties Environment. It lists all those $ vars as key-value pairs: enter image description here

查看更多
Fickle 薄情
6楼-- · 2019-01-08 05:13

Anybody working on legacy software using Visual Studio 6.0 will find that $(Configuration) and $(ProjectDir) macro's are not defined. For post-build/pre-build events, give a relative path starting with the location of your .dsw file(workspace) as the starting point. In relative path dot represents the current directory and .. represents the parent directory. Give a relative path to the file that need to be processed. Example: ( copy /y .\..\..\Debug\mylib.dll .\..\MyProject\Debug\ )

查看更多
登录 后发表回答