Hi,
I have two namespaces with same name. Can I refer both in same file?
Hi,
I have two namespaces with same name. Can I refer both in same file?
Yes, you can use an alias. See How to: Use the Namespace Alias Qualifier
Two relevant pats:
global::System.Console.WriteLine(number);
This will always work, even if you have other System
or Console
names.
using colAlias = System.Collections;
This lets you declare an alias for a given namespace.
Here is an example
using MyNamespace1 = Namespace1.Test.ClassName;
using MyNamespace2 = Namespace2.Test.ClassName;