Macros can be used in command line arguments for C ++ projects, see
How to pass solution folder as parameter in command line arguments (for debugging)?
You may have an empty C ++ project “Set as StartUp project” and change it “Configuration Properties → Debugging → Command” from “$ (TargetPath)” (by default for new projects) to “$ (ProjectDir)). \ OtherProjectRelativeDebugFolder \ OtherProjectsOutputFileName.exe ".
Since OtherProjectRelativeDebugFolder and OtherProjectsOutputFileName are relative and therefore location independent, you should be fine with this.
You said:
Hacking is fine if it's not too terrible!
Is an empty project that creates an empty dll (if you don’t find a way to stop it, for example, delete it during post-assembly) is too horrible?
BTW. Environment variables are not allowed in "Debug -> command line arguments" for C #. I will experiment with setting the environment variable by passing its name (because it is not allowed) and reading it in the program. The name transfer is intended to show where the environment variable comes from, i.e. Project parameters.
Edit: I was hoping to find a way to set the environment variable to a macro value, for example. in the build event. The simple "set" command line command is not constant, so it did not work. Instead, I was able to use the relative path as a working folder to make everything work for me. I also found a workaround that uses the file for permanent storage: VS2010 - Project macro variables in the "Startup options" command-line options
No answer
source share