Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass arguments when debugging a dot net application

Tags:

.net

console

I have an command line that uses arguments, I have no problem with this, but each time I want to test the application, I need to compile it, run the CMD, call the application with the parameters from the CMD, because I didn't find any solution that let me dynamically pass arguments to the console in Visual Studio Any idea about that? Thanks a lot!!

like image 863
Omar Abid Avatar asked Mar 12 '09 04:03

Omar Abid


People also ask

How do you pass arguments in Visual Studio debugging?

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 you pass command line arguments in dotnet run?

To pass arguments to your application, you need to pass a -- argument, and then the arguments to your application. As per the . NET Core CLI documentation, -- delimits arguments to dotnet run from arguments for the application being run. All arguments after this one are passed to the application run.

How do I Debug a .NET application?

Press F5 to run the program in Debug mode. Another way to start debugging is by choosing Debug > Start Debugging from the menu. Enter a string in the console window when the program prompts for a name, and then press Enter . Program execution stops when it reaches the breakpoint and before the Console.

How do you pass command line arguments in VB net console application?

Answers. To set the command line arguments in Visual Studio open the project property page and select the Debug tab at the right of the page and place the arguments in the text box marked Command line arguments as shown in the image below.


4 Answers

Goto Project->Properties and click the Debug Tab.

There is a section for command line arguments:

enter image description here

like image 114
Mitch Wheat Avatar answered Oct 10 '22 04:10

Mitch Wheat


Right click your project in VS -> Properties -> Debug tab

There is an area where you can specify command line arguments. When you debug your project, VS will start it up with these args.

like image 21
Andy White Avatar answered Oct 10 '22 06:10

Andy White


Go to the project properties - Debug section, and under the Start Options heading there is a section for Command line arguments.

like image 4
scott Avatar answered Oct 10 '22 05:10

scott


If you are using VS 2022, go to the project properties -> Debug -> General, and then click on "Open debug launch profiles UI".

like image 3
Gambali Avatar answered Oct 10 '22 04:10

Gambali