Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

C# namespace conflict ?

Posted on 2002-04-19
1
Medium Priority
?
1,577 Views
Last Modified: 2007-12-19
Is it possible to reference to environments' System namespace if project contains MyOwn.System namespace ?

below is simple example, there the Array class is not found, since only thing it founds from System. is the Sub class...

----
using System;

namespace MyOwn.System
{
  public class Sub
  {
    const int Number = 5;
  }
}

namespace MyOwn
{    
  public class Sub2
  {
    public Sub2()
    {
      System.Array a;   // Array is not found in System
    }
  }
}
0
Comment
Question by:TMan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 22

Accepted Solution

by:
CJ_S earned 632 total points
ID: 6957634
You can use the system namespace but you need to adjust your using statement to give the system namespace an alias.

using RealSystem = System;

And I suggest nesting. both together will solve your problem.

using RealSystem = System;

namespace MyOwn
{    
 public class Sub2
 {
   public Sub2()
   {
     RealSystem.Array a;   // Array is not found in System
   }
 }

 namespace System
 {
  public class Sub
  {
    const int Number = 5;
  }
}

}
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question