> 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.
Just 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.
Re:TIO: Try it online
by milesdyson_phd on Saturday July 15, 2017 @01:24PM
(#14777773)
You don't even need the namespace or the usings if you just want to print hello world either.
Re:TIO: Try it online
by solidsnack9000 on Sunday July 16, 2017 @12:04AM
(#14780420)
What does the minimal program actually look like?
Re:TIO: Try it online
by driekwartappel on Sunday July 16, 2017 @05:14AM
(#14781229)
This looks like the minimal:
class HelloWorld
{
static void Main()
{
System.Console.Write("Hello world!");
}
}
Try it online:
https://tio.run/##Sy7WTc4vSv3/PzknsbhYwSM1Jyc/PL8oJ4WrmktBob...No issues here: https://tio.run/##Sy7WTc4vSv3/PzknsbhYwbGgoLq4JLEkM1mhLD8zRc...
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