1

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?

3 Answers 3

2

Did you use following code?

using Company.System;

Use aliases for your own library.

using Company.System = Foo;
Sign up to request clarification or add additional context in comments.

Comments

1

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

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.