You need to create a project first. A file (no matter if it's even a complete C# app structure) is not a project in VS point of view, you need a project file.
Seeing the Attach button, usually means that you have opened Visual Studio without creating a project, and you have only opened a file.
Just follow these few quick steps:
- Open Visual Studio
- Choose "Create a new project"
- Search for "Console App", and click Next
- Specify the name of Project and click Next
- Choose framework version, and click Create
- After the project created, you can press F5
There you go!
Tutorial - Create a .NET console application using Visual Studio
You can learn more about console applications in the following articles:
- Tutorial: Create a .NET console application using Visual Studio
- Tutorial: Create a simple C# console app in Visual Studio (part 1 of 2)
Then if you have any question about a basic template for C# console application, you can take a look at: