The requested page is not available for the requested platform. You are viewing the content for Default platform.

Empty namespace declaration

CodeRush Classic shows the Empty namespace declaration code issue if a namespace declaration is empty.

Fix

Remove the empty namespace declaration.

Purpose

Empty namespace declaration directs your attention to empty namespace declarations, which can be removed to improve your code readability.

Example

namespace MyNamespace
{
    public class MyClass
    {
        public void OutputString(string str)
        {
            Console.WriteLine(str);
        }
    }namespace TestNamespace
    {

    }
}

Fix:

namespace MyNamespace
{
    public class MyClass
    {
        public void OutputString(string str)
        {
            Console.WriteLine(str);
        }
    }
}