C# doesn't use #include

All of the classes in all of the files are automatically available everywhere.  If a class is created inside the same project namespace then it can be used everywhere.  If it's in a different namespace you 'include' it with the "using" keyword.

There is no replacement for a C++ #include statement in C#. C# is an object-oriented language where code is organised into classes. You can use code from one class in another class depending on its visibility, and you can split the code from a single class across multiple source files using partial classes. 

 

Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.

Comments

Your email address will not be published. Required fields are marked *