1

I want to run a utility (mt.exe) as a post-build step in a C# project. There is an environment variable/macro defined as DevEnvDir accessed by $(DevEnvDir). However, mt.exe is an SDK tool and not in the Visual Studio executable tree. Visual C++ projects have the WindowsSdkDir variable accessible by $(WindowsSdkDir). Ideally, I would want to have in my C# post build project a line that starts something like:

$(WindowsSdkDir)bin\x86\mt.exe .....

Is there anyway to add the WindowsSdkDir environment variable/macro to my C# environment?

I realize I could hard code the path, but I want something I can share between machines and developers.

Joseph Willcoxson
  • 5,853
  • 1
  • 15
  • 29
  • Just a guess: Right-click properties, and go to the Reference Paths tab. – Alan Baljeu May 17 '16 at 17:32
  • The macros are specific to the project. C++ uses the SDK whereas C# does not. So, if you want to add your own macros, you'll have to edit the project and add them. http://stackoverflow.com/questions/13632282/in-visual-studio-2012-c-how-to-create-custom-macros-available-in-post-build – Chris Fannin May 17 '16 at 17:57

0 Answers0