C #: why can't I create a system namespace?

I remember a few weeks ago when I re-registered our code and created some namespaces in our project, I got an error and the system did not allow me to create a namespace companyName.projectName.System, I had to change it to companyName.projectName.Systeminfo. I do not know why. I know there is a namespace System, but it is not companyName.projectName.System. I think the namespace A.B.Cshould be different from the namespace A.A.C. Correctly?

EDIT

The error I received looks like this:

Error   7   The type or namespace name 'Windows' does not exist in the namespace 'MyCompany.SystemSoftware.System' (are you missing an assembly reference?) C:\workspace\SystemSoftware\SystemSoftware\obj\Release\src\startup\App.g.cs 39  39  SystemSoftware
+5
source share
5 answers

You have encountered a namespace conflict.

, , Microsoft (System) System ( System ...).

. "" .

.

+5

, , , , , companyName.projectName.System, .

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            var x = new ConsoleApplication1.Project.System.Something();
        }
    }
}
namespace ConsoleApplication1.Project.System
{
    public class Something
    {
    }
}
+5

, , .NET.

A.B.C, , A.B, C.ObjectName, A.B.C.ObjectName. , companyName.projectName, , .

, , , System - , .

+1

# . , Eric Lippert. , , .

0
source

Eric Lippert just posted on a related issue. http://blogs.msdn.com/ericlippert/archive/2010/03/09/do-not-name-a-class-the-same-as-its-namespace-part-one.aspx

Creating xySystem for code in xy namespaces makes it difficult to determine if you are referencing xySystem.Foo or System.Foo.

For clarity, I came up with a different name.

0
source

All Articles