Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add macros to visual studio project?

I need to add a macro to a visual studio project so that i could use this macro to set properties of the project.

enter image description here

e.g. I could replace 192.168.1.50 to a macro naming $(RemoteComputer).

Could I do this?

like image 379
Jichao Avatar asked Sep 10 '12 06:09

Jichao


1 Answers

Two options:

  1. Make it an environment variable like PATH or APPDATA (My Computer->Properties->Advanced->Environment Variables). Note that you need to restart MSVC or it will not find the new environment variables.
  2. If you want the setting only for a single project, then open the .vcxproj file and go to Project/PropertyGroup[Label="Globals"]. Add a new tag here, e.g. FooBar and it will appear as a $-macro in the studio-settings for that project.
like image 75
Alexander Tobias Bockstaller Avatar answered Oct 25 '22 03:10

Alexander Tobias Bockstaller