Skip to content

Latest commit

 

History

History
37 lines (31 loc) · 837 Bytes

cs0102.md

File metadata and controls

37 lines (31 loc) · 837 Bytes
description title ms.date f1_keywords helpviewer_keywords ms.assetid
Compiler Error CS0102
Compiler Error CS0102
07/20/2015
CS0102
CS0102
c9419779-649f-4c24-b0f3-f0a1be46659e

Compiler Error CS0102

The type 'type name' already contains a definition for 'identifier'

A class contains multiple declarations for identifiers with the same name at the same scope. To fix the error, rename the duplicate identifiers.

Example

The following sample generates CS0102.

// CS0102.cs  
// compile with: /target:library  
namespace MyApp  
{  
   public class MyClass  
   {  
      string s = "Hello";  
      string s = "Goodbye";   // CS0102  
  
      public void GetString()  
      {  
         string s = "Hello again";   // method scope, no error  
      }  
   }  
}