I started a course about C#, but when I tried to run the code there was no button, just a button named attach.
I searched online and have found no clue on how to solve this problem.
I was expecting to run my code in the Visual Studio Community.
I started a course about C#, but when I tried to run the code there was no button, just a button named attach.
I searched online and have found no clue on how to solve this problem.
I was expecting to run my code in the Visual Studio Community.
You can execute the code using the C# interactive window if you just want to execute C# code with no project.
To get the buttons you are asking about then you need to add your .CS file to a project. The easiest solution is to create a new project with the option to use existing files.
Microsoft link : Create a project from existing code files
You are using top-level statements. See link with explanation of this style vs a "Program.Main" type style program. A lot of examples will use the Program.Main style C# console app template generates top-level statements
If you receive an error like :
Error CS8370 Feature 'top-level statements' is not available in C# 7.3. Please use language version 9.0 or greater.