September 2006
This is a simple add-in for Visual Studio 2005 that can be used to set environment variables in the DevEnv.exe process. The add-in does the following:
You should already be aware that Visual Studio C/C++/NMake projects can further modify the spawned processes environments, and that those changes may conflict with yours.
There's no setup program for the add-in, because one of the things that I wrote the add-in for was to add the WiX tools to the environment so that I could build setups.
To set up the add-in simply:
A typical environment file might look like this:
This sample is included in the disribution.
The <Environment> tag is the element that defines an environment for your solution. This needs to have a Name attribute that matches the solution file name exactly. The <Set> elements should be self explanitory. You can define <Property> elements before any of the <Environment> elements, and substitute them in the appropriate Value attribute using $(PropertyName) in the attribute text. This is similar the way properties work in, say, MSBuild.
Any existing environment variables can also be substituted by using $(env.PATH). Note that everything is case sensitive. Be careful of that. Do a SET on the command line to see what the correct case is.
Copyright © Microsoft Corporation. All rights reserved.