In C# if I use a type alias like string
instead of (System.String
) then I do not need to add a using System;
directive - it compiles just fine.
However, if I change the type from the alias to the aliased Type explicitly - System.String
- then it will not compile without the using
directive. This seems to be true of all primitive Types (int
/Int32
, bool
/Boolean
) etc.
Why does the compiler import System
for me when using an alias but not when using the actual type name?