skip to Main Content

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

2

Answers


  1. 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 it
    Click that, type the name of your new file – ensuring it ends with .cs.
    You should now have a new file in your project

    Login or Signup to reply.
  2. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search