21

In the Visual Studio Debug property page (for a .NET 4 project) I want to be able to specify macros, e.g. $(OutDir), like I can in the Build Events. But it doesn't work, the macros aren't replaced.

Doesn't Work

Is it just not supported? Is there a work around?

1 Answer 1

21

It's not supported.

One explanation is that pre- and post-build events are stored in the project file, which goes into source control and is shared between all developers. Therefore it's important to have macros that resolve to different paths on different developers' machines.

Command arguments on the Debug property page are stored in the .user project file, which is user-specific and isn't stored in source control. Which means that you can generally safely used hard-wired arguments that are specific to your machine (and specific to the cases you want to test).

Sign up to request clarification or add additional context in comments.

1 Comment

Command arguments on the Debug property page are stored in the .user project file They don't have to be, I've configured a project to store the Debug properties in the csprojfile. <StartAction>Program</StartAction><StartProgram>C:\Windows\system32\cmd.exe</StartProgram><StartArguments>/c MigrateLocal.bat</StartArguments><StartWorkingDirectory>$(MSBuildProjectDirectory)</StartWorkingDirectory>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.