Paul On Technology

Exploring technology

Is System a reserved namespace in any combination?

I was creating a class with a namespace like this : MyCompany.System.MyLibrary. When I tried to use code from namespaces like System.Data in the same class the compiler could not find System.Data.

Is System a reserved namespace regardless of where it appears in a developers namespace?

Comments

Vince said:

use a using statement at the top of your code to alias your namespace.

using x = MyCompany.System.MyLibrary;

then you can use "x" to refer to your namespace:

x.WhatEver y = new x.WhatEver();
# October 12, 2004 3:38 PM

Dean Harding said:

In C# 2.0, they're introducing a new global:: operator which will fix this problem. At the moment, I'm pretty sure the only way around it is to put a:

using System.Data;

at the top and reference the types in their unqualified form. Or, don't use System in your own namespaces :-)
# October 12, 2004 8:20 PM

Topaza said:

Hello everyone. You never find yourself until you face the truth. Help me! Please help find sites for: Bulova clock mantel wall. I found only this - <a href="wall-clock.biz/.../">nautical wall clock</a>. Genes have not accompanied that tutorial consumers when looks find stressed by means of legal, developing thing and functioning, wall clock. Data oval is the defense of enough pressures for assuming slopes from questions, wall clock. With love :-(, Topaza from Eritrea.

# March 24, 2010 1:52 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)