Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Documentation for Debugging C# Console Applications with Input Arguments #7624

Open
asilverman opened this issue Sep 23, 2024 · 3 comments
Labels
doc-enhancement suggested addition or improvement

Comments

@asilverman
Copy link

As a C# developer, I often need to debug console applications that take input arguments. However, the current Visual Studio Code documentation does not provide clear guidance on how to set up debugging for such applications.

When I attempt to debug a C# console application with arguments, the dynamically generated debug configuration doesn’t support providing arguments and also doesn't actually save any launch.json files in my VSCode workspace. After some trial and error, I discovered that the command ".NET: Generate Assets for Build and Debug" that actually adds the launch.json configuration, which I could then modify to include command line arguments.

image

Request:

I would like to request that the documentation be updated to include instructions for debugging C# console applications with input arguments. This should ideally cover:

  1. How to use the ".NET: Generate assets for debugging" command to create the necessary launch.json configuration.
  2. How to modify the generated launch.json to specify input arguments for the application.

Adding this information would help other developers who face similar challenges and make the process of debugging C# applications in Visual Studio Code more straightforward.

Relevant Documentation Page:
Please update this information on the Visual Studio Code documentation page for C# debugging.

Thank you for considering this improvement!

@ntrogh
Copy link
Contributor

ntrogh commented Sep 24, 2024

Thanks for sharing your input, @asilverman

Looping in @webreidi

@ntrogh ntrogh added the doc-enhancement suggested addition or improvement label Sep 24, 2024
@webreidi
Copy link
Contributor

@asilverman are you using C# Dev Kit? If so, the out-of-the-box debugging (just F5) will run your console app in the terminal and you can interact with it right there in the terminal. No launch.json needed, no special configuration or any other assets. It should just work.

@ntrogh ntrogh added the info-needed Issue requires more information from poster label Sep 26, 2024
@asilverman
Copy link
Author

asilverman commented Sep 29, 2024

@webreidi - I am using C# devkit, the program I am looking to debug requires an input argument, the 'dynamically generated debug context' doesn't allow me to specify the argument and this is the problem I needed solved for which I found a workaround.

Running a program in debug with command line arguments is a very common thing and so what I am asking here is that it's made simple and for it to be documented for the benefit of the community.

In other words, to debug my program (console application) I must specify an input. The c# devkit f5 doesn't support any way to configure this input, this should be fixed

@ntrogh ntrogh removed the info-needed Issue requires more information from poster label Sep 30, 2024
2Lluisalberto added a commit to 2Lluisalberto/vscode-docs that referenced this issue Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-enhancement suggested addition or improvement
Projects
None yet
Development

No branches or pull requests

3 participants