including .cs ?

  • Thread starter Thread starter user
  • Start date Start date
U

user

Hello
I have classes (definition and body) in several .cs files, each .cs file
for each class. How can i 'include' them in my main project, so i could
use that class ?

Thanx
 
I have classes (definition and body) in several .cs files, each .cs file
for each class. How can i 'include' them in my main project, so i could
use that class ?
Step 1, add the .cs file to your Visual studio sollution.
Step 2, look up the namespace used by the clases you are interested in
Step 3, define "using" and the found namespace on top of the .cs file

Now this class should be available to you to be used.
 
To add to the other letter. If you are not using Visual Studio, you just
list the files after csc.exe

csc mymain.cs mysecondclass.cs myclasswiththingies.cs

The order of the files shouldn't matter as the one with static void Main()
will be treated as the main file and the exe name taken from that file.
 
Back
Top