Hey I am new to c# programming I had created a new console app in C# using vs code terminal and it gives a some files and one program.cs file where my program can write. What should I do to create another .cs file and run it the same project
Question posted in Visual Studio Code
View the official documentation.
View the official documentation.
2
Answers
In Visual Studio:
Right Click your project > Add > New Class
In Visual Studio Code:
In the explorer, where it says your project/folder name, there’s a tiny document icon with a
+
icon on itClick that, type the name of your new file – ensuring it ends with
.cs
.You should now have a new file in your project
Literally just create a text file called
Whatever.cs
and start typing; as long as it is inside the same folder structure as the project file (including sub-folders) and has the extension.cs
, it will be included in the build automatically.