FlyingPumba
FlyingPumba

Reputation: 1053

Several debugging profiles for Visual Studio 2017

Sometimes I want to run my program with argument X, and other times with argument Y.

I know I can change the debugging arguments in Project properties -> Debugging -> Command arguments.

But this means I have to change them manually every time I want to switch between arguments. I'm wondering if there is something similar to IntelliJ run configuration, where you can define several ways to run a project (with different arguments if you want to).

Upvotes: 0

Views: 671

Answers (1)

LoLance
LoLance

Reputation: 28116

If there is something similar to IntelliJ run configuration, where you can define several ways to run a project (with different arguments if you want to).

Yes, in vs2017 you can use Configuration Manager to create your new configuration(Copy settings from Debug config) And for different configuration, you can edit corresponding argument for them.

1.Right-click your solution in Solution Explorer, choose Configuration manager,in the drop-down list of solution configuration choose new to custom your new config, and for the goal of debugging, I suggest you copy settings from debug.

2.Right-click project->properties,you can define different arguments for different modes:

enter image description here

3.Save and if we want to use debug mode with different configuration, we can use the window below:Choose ConfigX to use argumentX, ConfigY to use argumentY, since they all copy settings from debug, they have no other difference except argument.

enter image description here

Hope it helps.

Upvotes: 1

Related Questions