C# Using Directive - Resolving Namespace Conflicts with Aliases
![](
I rarely encountered situations where class names across namespaces would conflict while using libraries, but it happened by chance. In the process of resolving it, I learned a new feature I didn't know existed.
Using Alias Directives
With the alias directive feature, you can:
![](
To resolve this kind of conflict:
![](
By specifying the namespace this way, you can use only the specific class you want. Additionally:
![](
Interestingly, as the feature name suggests, you can create separate aliases and rename types to entirely different identifiers. This seems like a very useful feature for educational purposes. It's equivalent to using "as" in Python's import statements.
Note that the code above is just to demonstrate the error resolution process and was written without much thought.
using directive - C# Reference