-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Console.ReadKey() Error #30917
Comments
Hello @YaraZakaria Thank you for your feedback! We will review and update as appropriate. |
@YaraZakaria I believe On the other hand, |
@PramodValavala-MSFT So how was I supposed to make it work without changing the code and by using the Console.ReadKey as supposed? |
@YaraZakaria Could you share details on the environment where you are running this code like the IDE, OS, etc. |
@PramodValavala-MSFT I'm running this on my VM having Windows Server 2016 Standard and Visual Studio Entreprise 2019. And the commands in git bash command. |
@YaraZakaria There seems to be a couple of inconsistencies when running interactive windows programs that use native windows API in If you are running the For winpty dotnet BasicSendReceiveQuickStart.dll -ConnectionString "myConnectionString" -QueueName "myQueueName" |
@PramodValavala-MSFT I tried with winpty and it works as expected. Thank you |
@YaraZakaria Glad we could help. We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue. |
Hi @YaraZakaria , @PramodValavala-MSFT , |
Hi @PramodValavala-MSFT ,
We encounter the problem in powershell
|
Hi, I'm following the steps as they are but i kept getting the following error :
Unhandled Exception: System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected. Try Console.Read.
at System.ConsolePal.ReadKey(Boolean intercept)
at System.Console.ReadKey()
at BasicSendReceiveQuickStart.Program.MainAsync(String ServiceBusConnectionString, String QueueName) in C:\Users\SMQK3813\source\repos\azure-service-bus\samples\DotNet\GettingStarted\BasicSendReceiveQuickStart\BasicSendReceiveQuickStart\Program.cs:line 57
at BasicSendReceiveQuickStart.Program.Main(String[] args) in C:\Users\SMQK3813\source\repos\azure-service-bus\samples\DotNet\GettingStarted\BasicSendReceiveQuickStart\BasicSendReceiveQuickStart\Program.cs:line 34
So I changed the "Console.ReadKey()" in the code to "Console.Read()" and now it works as expected.
Is there a simple explanation for this?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: