コンパイラ エラー CS0102

型 'type name' には既に 'identifier' の定義が含まれています

クラス内で、同じ名前の識別子が同じスコープで複数宣言されています。 このエラーを解決するには、重複する識別子の名前を変更します。

次の例では 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  
      }  
   }  
}