3 ms·
Not a comment about tio but I didn't realize it isn't possible to write a simple hello world in C# dot net core. What a shitty situation. What can we do to ma
by keganunderwood 9y ago
Not a comment about tio but I didn't realize it isn't possible to write a simple hello world in C# dot net core.
What a shitty situation.
What can we do to make it better? Provide a default csproj file on load? Any better ideas?
Microsoft (R) Build Engine version 15.3.117.23532
Copyright (C) Microsoft Corporation. All rights reserved.
code.cs(1,22): error CS1022: Type or namespace definition, or end-of-file expected [/home/runner/project/project.csproj]
code.cs(1,22): error CS1026: ) expected [/home/runner/project/project.csproj]
Build FAILED.
code.cs(1,22): error CS1022: Type or namespace definition, or end-of-file expected [/home/runner/project/project.csproj]
code.cs(1,22): error CS1026: ) expected [/home/runner/project/project.csproj]
0 Warning(s)
2 Error(s)
Time Elapsed 00:00:04.92
No executable found matching command "dotnet-project/bin/Debug/netcoreapp*/project.dll"
Real time: 6.033 s
User time: 2.973 s
Sys. time: 0.442 s
CPU share: 56.61 %
Exit code: 1
- eterm 9y agoJust filling in some default fields in the tio editor would do. For example pre-fill the header as: using System; using System.IO; and pre-filling Code with namespace example { public class Example { static void Main(){ } } } (But better names, my naming sucks!) That would go a long way, then you could just add "Console.WriteLine("Hello World"); for hello world.
- milesdyson_phd 9y agoYou don't even need the namespace or the usings if you just want to print hello world either.
- solidsnack9000 9y agoWhat does the minimal program actually look like?
- driekwartappel 9y agoThis looks like the minimal: class HelloWorld { static void Main() { System.Console.Write("Hello world!"); } } Try it online: https://tio.run/##Sy7WTc4vSv3/PzknsbhYwSM1Jyc/PL8oJ4WrmktBobgksSQzWaEsPzNFwTcxM09DEygIkgCC4MriktRcPef8vOL8nFS98KLMklQNJbABCuUgExSVNK2BSmu5av//BwA https://tio.run/##Sy7WTc4vSv3/PzknsbhYwSM1Jyc/PL8oJ4WrmktBob...
- fizixer 9y ago> Not a comment about tio but I didn't realize it isn't possible to write a simple hello world in C# dot net core. Not sure why you'd think it's impossible [1]. I even ran it in the TIO C# console and it works. [1] https://rosettacode.org/wiki/Hello_world/Text#C.23 https://rosettacode.org/wiki/Hello_world/Text#C.23
- egor598 9y agoThis works for me in TIO: public class App { public static void Main(string[] args) { System.Console.WriteLine("Hello World"); } }
- pavelbr 9y agoNo issues here: https://tio.run/##Sy7WTc4vSv3/PzknsbhYwbGgoLq4JLEkM1mhLD8zRcE3MTNPQ7M6uLK4JDVXzzk/rzg/J1UvvCizJNUnMy9VQ8kjNScnX0chPL8oJ0VRSdO6tvb/fwA https://tio.run/##Sy7WTc4vSv3/PzknsbhYwbGgoLq4JLEkM1mhLD8zRc...