This documentation is archived and is not being maintained.

Compiler Error CS0011

Referenced class 'class1' has base class or interface 'base1' defined in an assembly that is not referenced. You must add a reference to assembly 'assembly'.

A class that was imported from a file with /reference, is derived from a class or implements an interface that is not found. This could occur if a required .DLL is not also included in the compilation with /reference.

See Add Reference Dialog Box for information on how to add a reference in the development environment.

The following sequence of compilations will result in CS0011:

// CS0011_1.cs
// compile with: /target:library
public class B1
{
}

Then:

// CS0011_2.cs
// compile with: /r:CS0011_1.dll /target:library
public class B2: B1
{
}

Then:

// CS0011_3.CS
// compile with: /r:CS0011_2.dll
// CS0011 expected
// to fix, compile with: /r:CS0011_1.dll;CS0011_2.dll
class D1
{
   public B2 b2 = null;
   public static void Main()
   {
   }
}
Show: