Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET core command line arguments in the debugger

Tags:

asp.net-core

When I debug some asp.net with net 4.7 code, I can specify some arguments in the debugger and the main function is getting them.

I realized that this is not happening with .net core; I can put whatever I want in the "Application arguments" in the debugger tab, the application never sees that data.

Is that yet another case of VS' interface not matching .net core? or did I miss something obvious?


Adding more details:

enter image description here

enter image description here

like image 506
Thomas Avatar asked Jan 23 '18 01:01

Thomas


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 Debug a .NET core console app?

Start debuggingOpen the Debug view by selecting the Debugging icon on the left side menu. Select the green arrow at the top of the pane, next to . NET Core Launch (console). Other ways to start the program in debugging mode are by pressing F5 or choosing Run > Start Debugging from the menu.


1 Answers

Please confirm Project Setting file changes are saved.

In case of .NET Core project, it does not save automatically, even if solution compiled.

enter image description here

like image 182
idubnori Avatar answered Sep 26 '22 23:09

idubnori