Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

Compiler Warning (level 1) CS1595

Visual Studio .NET 2003

'type' is defined in multiple places; using definition from 'assembly'

A project referenced two assemblies, each of which contains the same type definition. The compiler chose one of the assemblies from which to take the definition of type based on the order of files passed to /reference.

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

The following sequence of compilations generates CS1595:

// CS1595_1.cs
// compile with: /W:1 /target:library
namespace N1
{
   public class C1
   {
      public C1()
      {
         System.Console.WriteLine("Hi1");
      }
   }
}
// CS1595_2.cs
// compile with: /t:library
namespace N1
{
   public class C1
   {
      public C1()
      {
         System.Console.WriteLine("Hi2");
      }
   }
}
// CS1595_3.cs
// compile with: /r:CS1595_1.dll,CS1595_2.dll
class Test
{
   public static void Main(string[] args)
   {
      N1.C1 obj = new N1.C1();   // CS1595
   }
}
Show:
© 2015 Microsoft