Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# C# Basics (Retired) Perfect Documentation

What is the difference between System namespace and System.IO namespace?

Is there a difference or is it an alias?

1 Answer

Steven Parker
Steven Parker
231,236 Points

The System and System.IO namespaces have different contents.

The System namespace contains fundamental classes and base classes that define commonly-used value and reference data types, events and event handlers, interfaces, attributes, and processing exceptions. This would include classes such as Array, Buffer, Console, Convert, Math, Object, Random, and String. Each class provides a number of useful methods.

The System.IO namespace contains types that allow reading and writing to files and data streams, and types that provide basic file and directory support. This includes classes such as Directory, DirectoryInfo, File, FileInfo, FileStream, Stream, StreamReader, and StreamWriter. Each of these classes provide their own set of useful methods.