Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use macros for the command line arguments for debugging a .NET project?

Tags:

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?

like image 838
Ray Avatar asked May 05 '10 16:05

Ray


People also ask

How do I debug command line arguments in Visual Studio?

To set command-line arguments in Visual Studio, right click on the project name, then go to Properties. In the Properties Pane, go to "Debugging", and in this pane is a line for "Command-line arguments." Add the values you would like to use on this line. They will be passed to the program via the argv array.

How do I debug a macro in Visual Studio?

Open up a source file from your manage project in Visual Studio and set a breakpoint on a line. Start debugging in Visual Studio by pressing F5. In Excel, open up your worksheet and start debugging your VBA code using Excel's debugger.


1 Answers

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).

like image 106
Joe Avatar answered Sep 21 '22 11:09

Joe