How do you set environmental variables for visual studio 2008 sp1?

233 Views Asked by At

There are common environmental variables in a project I received such as $(OUTDIR) and $(PROJECTNAME) that are relative to Visual Studio as found on MSDN webpage Macros for Build Commands and Properties

Are these just common environmental variables that are used by Visual Studio? Do they need to be set in the project properties itself or the system environmental variables? How to set environmental variables in VisualStdio?

1

There are 1 best solutions below

0
Bryant On

I'm using VisualStdio 2008. Some of those can be set, and some cannot. For example, $OutDir would be set under Project Properties, Configuration

Properties -> General -> Output directory

for C++ projects, and

Project Properties -> Build -> Output path

for C# projects.

Many of them cannot be changed explicitly. For example, $(SolutionDir) is always the full path to the .sln file. You can move the file, but you cannot change the value explicitly.

For a C++ project, most text fields have a dropdown menu, which will let you bring up an edit window. Click on "Macros" to show them all, and their current values. For a C# project, I think the only place they can be used is in the build events tab: Click the button to bring up a separate edit window, and it will have the same "Macros" button.