C# Error CS0811 – The fully qualified name for ‘{0}’ is too long for debug information. Compile without ‘/debug’ option.

C# Error

CS0811 – The fully qualified name for ‘{0}’ is too long for debug information. Compile without ‘/debug’ option.

Reason for the Error & Solution

The fully qualified name for ‘name’ is too long for debug information. Compile without ‘/debug’ option.

There are size constraints on variable and type names in debug information.

To correct this error

  1. If modifying the name is not possible, the only alternative is to compile without the option.

Example

The following code generates CS0811:

// cs0811.cs  
//Compile with: /debug  
using System;  
using System.Collections.Generic;  
  
namespace TestNamespace  
{  
    using Long = List<List<List<List<List<List<List<List<List<List<List<List<List  
   <List<List<List<List<List<List<List<List<List<List<List<List<List<List<List<int>>>>>>>>>>>>>>>>>>>>>>>>>>>>; // CS0811  
  
    class Test  
    {  
        static int Main()  
        {  
            return 1;  
        }  
    }  
}  

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

C# Compiler Error CS0442 – ‘Property’: abstract properties cannot have private accessors Reason for the Error You’ll get this error...
This is a really simple one . Below is a simple example of an enum called “Designation” defined with the...
This blog post explain the usage of the Checked Block in .NET and how you can use them in Visual...