I have custom classes in Company.System namespace. But now I am writing code referencing to System, but it is referenced to Company.System. I can use global::System to specify .NET System namespace, but when I am creating service installers by visual studio (ie), all classes are referenced to Company.System and designers does not work. How can I solve this situation?
Add a comment
|
3 Answers
you have to use aliases to differentiate between one namespace and another: like
using colAlias = System.Collections;
colAlias::Hashtable test = new colAlias::Hashtable();
more info here: http://msdn.microsoft.com/en-us/library/c3ay4x3d(v=vs.80).aspx
Comments
The most obvious solution is to rename your Company.System namespace - it's only going to cause grief for you and the poor maintenance developers down the line.
Another approach is to use the Aliases feature (see http://msdn.microsoft.com/en-us/library/ms173212(v=vs.80).aspx) when adding a reference to the assembly(ies) containing the Company.System namespace.