简体   繁体   中英

C# Dotnet Run Issue with Ubuntu Terminal

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM