by keganunderwood · 9y ago · 0 comments
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
Not sure why you'd think it's impossible [1]. I even ran it in the TIO C# console and it works.
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.
class HelloWorld
{
static void Main()
{
System.Console.Write("Hello world!");
}
}
Try it online:
https://tio.run/##Sy7WTc4vSv3/PzknsbhYwSM1Jyc/PL8oJ4WrmktBob...public class App { public static void Main(string[] args) { System.Console.WriteLine("Hello World"); } }