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

[BUG] Improve C# Dev Kit Debugging Walkthrough #130

Closed
bamurtaugh opened this issue Jun 13, 2023 · 10 comments
Closed

[BUG] Improve C# Dev Kit Debugging Walkthrough #130

bamurtaugh opened this issue Jun 13, 2023 · 10 comments
Assignees
Labels
area-dotnet-debugging Issues around .NET Debugging with console, ASP.NET, or Aspire bug Something isn't working needs-more-info Needing more information, waiting on OP

Comments

@bamurtaugh
Copy link
Member

Describe the Issue

Following the steps in the doc, I'm unclear if I should use the Run and Debug view or not when I'm using the C# Dev Kit.

I was thinking yes as it's mentioned in docs and in the getting started walkthrough:

image

But based on the results and some other info in docs, I'm not sure.

Steps To Reproduce

  1. Open Run and Debug view, see I don't have any launch configurations
  2. Follow steps in doc to select a C# launch config
  3. Try using Run and Debug
  4. I don't see the output of my console app

image

Expected Behavior

I expected to see my console app's "Hello, World!" output in the terminal the same way I see the output when I use F5.

Environment Information

I'm using a .NET dev container with the latest VS Code Insiders on Windows 11 Insiders.

Version: 1.80.0-insider (user setup)
Commit: 79c4092768e41b16fd823e80c874dbfafdc08f55
Date: 2023-06-13T05:21:23.732Z
Electron: 22.5.5
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.25387

@bamurtaugh bamurtaugh added the bug Something isn't working label Jun 13, 2023
@tmeschter tmeschter added the area-dotnet-debugging Issues around .NET Debugging with console, ASP.NET, or Aspire label Jun 13, 2023
@WardenGnaw WardenGnaw self-assigned this Jun 13, 2023
@WardenGnaw
Copy link
Member

Do you see the output in the Debug Console tab?

By default, the settings for output is set to the internalConsole. You can change this option in your User Settings.
See https://code.visualstudio.com/docs/csharp/debugging#_user-settings

@WardenGnaw WardenGnaw added the needs-more-info Needing more information, waiting on OP label Jun 13, 2023
@bamurtaugh
Copy link
Member Author

Ah yes, I see it if I go to the Debug Console, thank you!

I think it'd be helpful to highlight that in the walkthrough and/or an FAQ section of the debug doc. Right now the walkthrough points me to docs and to open the Run and Debug, and just opening Run and Debug isn't sufficient to see my output.

image

@WardenGnaw WardenGnaw changed the title [BUG] Should Run & Debug show my console app output with C# Dev Kit? [BUG] Improve C# Dev Kit Debugging Walkthrough Jun 13, 2023
@WardenGnaw
Copy link
Member

Ideally VS Code should focus on Debug Console if the console type is set to internalConsole or focus on Terminal if set to integratedTerminal or with externalWindow a popup for the output should show. But I can improve the docs on the walk through .

@bamurtaugh
Copy link
Member Author

Ideally VS Code should focus on Debug Console if the console type is set to internalConsole or focus on Terminal if set to integratedTerminal or with externalWindow a popup for the output should show.

@Tyriar @connor4312 would this be a feature request for VS Code core? (tagging you both for the terminal and debugging aspect)

@WardenGnaw
Copy link
Member

Added notes, console is our launch.json configuration option, but VS Code should get a runInTerminal request if we set it to integratedTerminal. If not it should default to showing the Debug Console.

@connor4312
Copy link
Member

connor4312 commented Jun 13, 2023

VS Code should focus on Debug Console if the console type is set to internalConsole or focus on Terminal if set to integratedTerminal or with externalWindow a popup for the output should show.

This is already the case, and is configurable by users.

@bamurtaugh
Copy link
Member Author

bamurtaugh commented Jun 13, 2023

This is already the case, and is configurable by users.

The original issue I filed is because VS Code stayed focused on the integrated terminal, though the output was set to Debug Console, so I didn't see anything when I first ran. I could manually change my focus to the Debug Console to see the output, which I didn't expect since I thought other extensions automatically changed my focus. But perhaps this is expected?

@Tyriar
Copy link
Member

Tyriar commented Jun 13, 2023

@bamurtaugh it's controlled bydebug.internalConsoleOptions, I have it set to "neverOpen" so I'm just assuming it still works.

@bamurtaugh
Copy link
Member Author

Thanks @Tyriar. Looks like mine is openOnFirstSessionStart, so maybe what happened is:

  • I ran once and debug console opened
  • I tried running again, and debug console didn't open because it wasn't my first session

@WardenGnaw
Copy link
Member

In a newer version of C# Extension, you should be able to input ReadLine/Read with the Debug Console.

See dotnet/vscode-csharp#6569

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dotnet-debugging Issues around .NET Debugging with console, ASP.NET, or Aspire bug Something isn't working needs-more-info Needing more information, waiting on OP
Projects
None yet
Development

No branches or pull requests

5 participants