3ggerhappy
3ggerhappy

Reputation: 223

Getting Visual Studio Environment Variable Programmatically?

Is it possible to get this variables programmatically?

http://msdn.microsoft.com/en-us/library/c02as0cs(VS.90).aspx

so inline with my question here I need to get the actual value of these variables programmatically outside of visual studio. Can I use "GetEnvironmentVariable(String, EnvironmentVariableTarget)" for this?or any other suggestions

getting the value of $(ProjectDir), $(SolutionDir) in a vcproj file

Upvotes: 1

Views: 1412

Answers (1)

Hans Passant
Hans Passant

Reputation: 942050

They are not environment variables. Macros is the name used in the MSDN literature. Maybe that makes sense if you realize that a solution can contain more than one project. $(ProjectDir) constantly changes as the build progresses. You already know their values, $(ProjectDir) is the directory where you found the .vcproj file, $(SolutionDir) is the directory where you found the .sln file. (This sounds familiar).

Upvotes: 1

Related Questions