Rename the project code file to match your code file name.In the new project, replace all the code in the project code file with the contents of your first code listing or file.Use the C# Console Application if you're not sure. Start Visual Studio, and create a new project of the appropriate type.cs file with the contents of your code listing or file.
Start Visual Studio, and open an empty C# Console Application project.You can use the Console Application template to create a project to work with the app in Visual Studio. Any app with a Main method is probably a runnable program, but with the current version of C#, programs without Main methods with top-level statements can also run. If you start from a code listing, code file, or small number of files, first make sure the code is a runnable program from a trusted source. Console apps run in a terminal window, Windows desktop apps start in a new desktop window, and web apps run in a browser hosted by IIS Express. If the build succeeds, the app runs as appropriate for the type of project. At the bottom of the Visual Studio screen, the build output appears in the Output window, and any build errors appear in the Error List window. Visual Studio tries to build and run your project. To run the program, press Ctrl+ F5, select Debug > Start without debugging from the top menu, or select the green Start button.