Home > database >  C# Dotnet Run Issue with Ubuntu Terminal
C# Dotnet Run Issue with Ubuntu Terminal

Time:11-24

I am attempting to setup .net on my linux machine to do some C# coding practice but I have run into a very frustrating issue.

My terminal refuses to display Console.WriteLine() functions. Even a simple hello world. Using the command dotnet run just hangs for a few seconds and then sends me to the next line waiting for another command. I know the runtime is working because if I intentionally write a coding error the terminal displayed the error. I'm getting extremely frustrated with this.

I've also tried using VSCode and the terminal in that (Yeah i get its essentially the same thing) but it does the same thing on dotnet run hangs for a second and then just proceeds to the next line. I feel like the output is coming out somewhere but I'm not sure where.

Host :

Version: 6.0.0

Commit: 4822e3c3aa

.NET SDKs installed:

6.0.100 [/snap/dotnet-sdk/150/sdk]

.NET runtimes installed:

Microsoft.AspNetCore.App 6.0.0 [/snap/dotnet-sdk/150/shared/Microsoft.AspNetCore.App]

Microsoft.NETCore.App 6.0.0 [/snap/dotnet-sdk/150/shared/Microsoft.NETCore.A

Console.WriteLine("Hello World!"); 

     The code running in terminal is

dotnet run

CodePudding user response:

This behavior is already noticed in any linux distribution, I already see it in Debian. Is about the time needed of the main pid to compile and get the references of self contained distributable. The solution in consideration is install the needed libraries in the system prior to the execution, but the time of processing is still not the same than in Windows.

CodePudding user response:

This article maybe helpful, check it out. https://developer.okta.com/blog/2020/11/25/how-to-install-dotnetcore-on-linux

  • Related