Reputation: 2862
I would like to define user environment variables in a Visual Studio solution. Then I would like to use them in the project files. For example:
<ProjectReference Include="$(MyUserVar)\MyProject.csproj">
Is it possible?
Upvotes: 4
Views: 2833
Reputation: 50687
This can be done in the VS property sheet.
Go to the Property Manager
tab if it's not highlighted yet.
Double click on the newly created property sheet.
Go to the User Macros
node and press the Add Macro
button. Insert name to the value field as you'd like and set this macro as an environment variable in the build environment
.
Detailed step-by-step instructions can be referred here: https://sites.google.com/site/pinyotae/Home/visual-studio-visual-c/create-user-defined-environment-variables-macros (archived)
Upvotes: 1