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

Unable to read input from the console with C# #50

Closed
nightblade9 opened this issue Mar 20, 2023 · 1 comment
Closed

Unable to read input from the console with C# #50

nightblade9 opened this issue Mar 20, 2023 · 1 comment

Comments

@nightblade9
Copy link

nightblade9 commented Mar 20, 2023

Issue Description

VSCode terminal doesn't allow me to read from the console. Two things that appear incorrect:

  • When I run my application, the output appears in Debug Console instead of in Terminal
  • When I type anything in Debug Console, I get error 80070057

Steps to Reproduce

Simple option: follow these MSDN instructions.

My distilled-down version:

  • `dotnet new console --name test
  • Open up Program.cs and add your choice of Console.Read, Console.ReadLine, or Console.ReadKey to the end
  • Configure VSCode with launch.json - make sure you set console to integratedTerminal or externalTerminal
  • I was told to also set internalConsoleOptions to neverOpen, although this seems to make no difference
  • Run/debug the application
  • Type something. Anything.

Expected Behavior

You should be able to read from the terminal and continue running the application

Actual Behavior

There is no way to send input in.

  • Typing anything in the Debug Console prints error 0x80070057
  • Typing anything in Terminal closes the terminal

Logs

I don't know what logs to provide, please advise.

OmniSharp log

Starting OmniSharp server at 3/19/2023, 12:12:23 p.m.
    Target: /home/nb/code/obsidian-mountain/source/ObsidianMountain.sln

OmniSharp server started with .NET 6.0.113
.
    Path: /home/nb/.vscode-oss/extensions/muhammad-sammy.csharp-1.25.0-universal/.omnisharp/1.39.0-net6.0/OmniSharp.dll
    PID: 7498

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on Unknown 0.0 (Unknown)
[info]: OmniSharp.Services.DotNetCliService
        Checking the 'DOTNET_ROOT' environment variable to find a .NET SDK
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to /usr/share/dotnet/dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: .NET Core SDK 6.0.113 17.0.1 - "/usr/share/dotnet/sdk/6.0.113/"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: .NET Core SDK 6.0.113 17.0.1 - "/usr/share/dotnet/sdk/6.0.113/"
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.MSBuild.ProjectSystem
        Detecting projects in '/home/nb/code/obsidian-mountain/source/ObsidianMountain.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/home/nb/code/obsidian-mountain/source/ObsidianMountain.Console/ObsidianMountain.Console.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/home/nb/code/obsidian-mountain/source/ObsidianMountain.Core/ObsidianMountain.Core.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/home/nb/code/obsidian-mountain/source'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Did not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location '/home/nb/code/obsidian-mountain/source' on host 7334.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /home/nb/code/obsidian-mountain/source/ObsidianMountain.Console/ObsidianMountain.Console.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/home/nb/code/obsidian-mountain/source/ObsidianMountain.Console/ObsidianMountain.Console.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/home/nb/code/obsidian-mountain/source/ObsidianMountain.Console/ObsidianMountain.Console.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /home/nb/code/obsidian-mountain/source/ObsidianMountain.Core/ObsidianMountain.Core.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/home/nb/code/obsidian-mountain/source/ObsidianMountain.Core/ObsidianMountain.Core.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/home/nb/code/obsidian-mountain/source/ObsidianMountain.Core/ObsidianMountain.Core.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: ObsidianMountain.Console
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: ObsidianMountain.Core

C# log

There is nothing logged in Output -> C#

Environment information

VSCode version: 1.75.1
C# Extension: 1.25.0

Mono Information There is a problem with running OmniSharp on mono: Error: Unable to find Mono. Ensure that Mono's '/bin' folder is added to your environment's PATH variable.
Dotnet Information .NET SDK (reflecting any global.json): Version: 6.0.113 Commit: 4a23b50f97

Runtime Environment:
OS Name: manjaro
OS Version:
OS Platform: Linux
RID: arch-x64
Base Path: /usr/share/dotnet/sdk/6.0.113/

Host:
Version: 7.0.2
Architecture: x64
Commit: d037e070eb

.NET SDKs installed:
6.0.113 [/usr/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.NETCore.App 6.0.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
DOTNET_ROOT [/usr/share/dotnet]

global.json file:
Not found

Learn more:
https://aka.ms/dotnet/info

Download .NET:
https://aka.ms/dotnet/download

Visual Studio Code Extensions
Extension Author Version
csharp muhammad-sammy 1.25.0
markdown-preview-enhanced shd101wyy 0.6.8
simple-rst trond-snekvik 1.5.2
muhammadsammy pushed a commit that referenced this issue Sep 1, 2023
Add basic project implementation to unblock progress on LSP handlers
@nikola-godzilla
Copy link

See #38
to debug code with ReadLine use Miscrosoft extension with their VS Code. C# Dev Kit / C#
Or don't use ReadLine

@nightblade9 nightblade9 closed this as not planned Won't fix, can't repro, duplicate, stale Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants