-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Updating tutorials for C# Dev KIt #41440
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good, I left a few comments. I've only gone through the first tutorial, will start on 2-5 Monday. I'm only reviewing .NET 8 sections -- I left a comment with suggestions on how to deal with 6-7.
Co-authored-by: Tom Dykstra <[email protected]>
Co-authored-by: Tom Dykstra <[email protected]>
Co-authored-by: Tom Dykstra <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I noted some minor issues and one that will take some time to fix (terminal vs. debug console).
@@ -62,11 +48,11 @@ The breakpoint is located after a `Console.ReadLine` method call. The **Debug Co | |||
|
|||
:::image type="content" source="media/debugging-with-visual-studio-code/start-debugging.png" alt-text="Start debugging"::: | |||
|
|||
1. Select the **Terminal** tab to see the "What is your name?" prompt that the program displays before waiting for a response. | |||
1. Select the **Debug Console** tab to see the "What is your name?" prompt that the program displays before waiting for a response. | |||
|
|||
:::image type="content" source="media/debugging-with-visual-studio-code/select-terminal-net6.png" alt-text="Select the Terminal tab"::: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The text is correct, but the image is out of sync with it, still showing Terminal selected, with the program output in the Terminal.
@@ -90,8 +76,6 @@ The **Debug Console** window lets you interact with the application you're debug | |||
|
|||
:::image type="content" source="media/debugging-with-visual-studio-code/continue-debugging.png" alt-text="Continue debugging"::: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With these changes to the tutorial, it throws an exception at this point:
An unhandled exception of type 'System.InvalidOperationException' occurred in System.Console.dll: 'Cannot read keys when either application does not have a console or when console input has been redirected. Try Console.Read.'
This is because we are reading from the console, whereas the previous tutorial version read from the terminal.
We will have to make a new version of the code, with Console.ReadLine() and "Press enter to continue" at the end instead of Console.ReadKey(true) and "Press any key to continue" Right now the 3 versions (VS, VS Mac, VSC) of tutorials 1 and 2 share the code file that has the code for "enhance the app" in tutorial 1, so we need to do one of the following:
- Make a separate copy of the code, probably easiest to use preprocessor directives so both versions of the code can be in the same file -- https://github.com/dotnet/docs/blob/main/docs/core/tutorials/snippets/with-visual-studio/csharp/Program.cs
- Keep one version of the code and update the VS and VSMac tutorials to fit.
And with this change, the rest of tutorials 1 and 2 will need changes in many places where it talks about the terminal or the debug console.
@webreidi If your time for working on this is limited at the moment, let me know if you'd like me to address the remaining feedback myself in a PR to your PR branch. I expect to have some time I could spend on it next week. |
Co-authored-by: Tom Dykstra <[email protected]>
Co-authored-by: Tom Dykstra <[email protected]>
Co-authored-by: Tom Dykstra <[email protected]>
Co-authored-by: Tom Dykstra <[email protected]>
Co-authored-by: Tom Dykstra <[email protected]>
Co-authored-by: Tom Dykstra <[email protected]>
Co-authored-by: Tom Dykstra <[email protected]>
Yeah, I get very limited time to work on things as I'm pulled in a million directions. If you have time to finish this one up, I would greatly appreciate it. |
Summary
I've updated a set of the dotnet tutorials for VS Code to incorporate the usage of C# Dev Kit. I'll be doing a set of these periodically as I get time.
Fixes #Issue_Number (if available)
Internal previews