Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Property Pages Environment Variables

If you right click on a project in solution explorer and go to General -> Debugging there is an Environment section where you should be able to set environment variables using the syntax NAME=VALUE. My problem is that if I try to create a new environment variable there it doesn't seem to actually work or get set. Does anyone have any experience with this? I just want to set an environment variable so I can use it in custom build steps like this:

environment variable

LANGUAGE_VAR=en_us

custom build step

copy $(InputPath) $(outDir)\%LANGUAGE_VAR%\$(InputFileName)

Something similar to that. This MSDN page is useful but I can't get it to work: http://msdn.microsoft.com/en-us/library/ms173406.aspx#1

like image 846
tonyg Avatar asked Nov 04 '22 12:11

tonyg


1 Answers

Actually what I found that was very helpful to me was going to Property Manager -> Select the property pages that all my projects inherit -> Double click to open the property pages editor -> Click User Macros -> Add a macro and define it's NAME and VALUE.

Now in my custom build steps I can refer to that macro.

So if my macro was LANGUAGE=en_us I can run a build and build out all the en_us stuff I want. If I go back to Property Manager and change the value of LANGUAGE to es_es then I can run a build and my build steps will get es_es instead of en_us. I hope that isn't too confusing. PM me if you have this problem and don't know what I'm talking about.

like image 152
tonyg Avatar answered Nov 15 '22 06:11

tonyg