question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Visual Studio 2019 - Console Unit Fails

See original GitHub issue

Hi

I have a unit test that compares two numbers. In VS 2017, this test passes without any issues. I installed VS 2019 and the following exception gets thrown, when running my unit tests:

Message: The handle is invalid at System.ConsolePal.GetBufferInfo(Boolean throwOnNoConsole, Boolean& succeeded) at System.Console.get_CursorTop()

which happens at this point in the code:

boardTop = Console.CursorTop + 1;

However. if I debug the Unit Test, it passes.

NUnit v3.11.0 NUnit 3TestAdapter v3.13.0

*Update

I have tested the units on Visual Studio 2019 for Mac and the test run correctly.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:10 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
mikkelbucommented, Apr 29, 2019

@kendrahavens @OsirisTerje I’ve created https://developercommunity.visualstudio.com/content/problem/551129/change-in-behaviour-between-vs-2017-and-vs-2019-wh.html, but I’ve not provided any information about how this impacts my workflow, as the problem was experienced by @VisualSanity, I just helped to diagnose the problem. Perhaps @VisualSanity can provide the information on developercommunity.

0reactions
kendrahavenscommented, Apr 25, 2019

@mikkelbu I believe this is a Visual Studio issue. We did change some behavior in the console window in Visual Studio 2019. Could you open a bug on https://developercommunity.visualstudio.com/ ? Thank you for including the repro solution! Any details you can include on how this impacts your workflow would be greatly appreciated. (i.e. Let us know if this is a major breaking scenario!)

I am also observing this on my machine, but am not sure of the cause. Filing it on developer community will help route it to the right team.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS 2019 Console.Writeline - Output not present in ...
My app is a C# Windows Forms App (not a WPF app). But the output is simply not appearing in the Output window...
Read more >
Console window not Opening (Visual Studio 2019)
Seems like a rudimentary question but I cannot open the console window with ctrl and F5 as I used to. I start debugging...
Read more >
Problems with the console in Visual studio 2019 windows
I have a problem with the console in Visual studio that I could not find a solution to for a very long time....
Read more >
Visual Studio 2019 Build Failed But No Errors ...
When I right-click to Build the project, it fails but there are no errors. Each time the compilation fails, the process increases by...
Read more >
Debugging in Visual Studio 2019 doesn't work if I create a ...
I have dotnet version 5.0.101. When I create a new console application in PowerShell using the command: dotnet new console and open it...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found