How do I set Environment Variables in Visual Studio 2010?
I found this web page.
Which says:
From the Project menu, choose Properties.
In the left pane, select Configuration Properties, and then select Environment.
But when I select "Configuration Properties", there is no "Enviroment" option:
This is an example in VS 2008:
But how is it done in VS 2010?
You are comparing a C++ project in VS2008 to a C# project in VS2010. These two projects use different kind of build engine. VS2008 C++ project use a make-based build and use heavily environment variables. VS2010 (and VS2008 for that matter) C# projects use MSBuild and rarely (1) depend on environment variables.
Unless you have modified your .csproj file or have a custom build tool, changing environment variables should not be the way to do whatever you want to it is. If you describe your goal, we'll be able to better help you with advice how to achieve it.
Update: MSBuild can use environment vairables. However, VS does not provide an UI to set those for standard C# projects (even if you install earlier version). Most probably the build project you are looking at is intended to be build from the command line using msbuild.exe
.
You have couple of options:
<PropertyGroup>
element the particular variable you need with the value you want to set. (properties set in a work for MSBuild like environment variables for Make) msbuild /property:<name>=<value> ...
(1) I was tempted to say "never", but I do have couple of projects where I want the build to depend on environment variables, mostly to enable automated builds on machines without .Net installed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With