Share via


컴파일러 경고(수준 2) CS0437

업데이트: 2007년 11월

오류 메시지

'assembly2'의 'type' 형식이 'fassembly1'의 가져온 네임스페이스 'namespace'과(와) 충돌합니다. 'assembly'에 정의된 형식을 사용합니다.
The type 'type' in 'assembly2' conflicts with the imported namespace 'namespace' in 'fassembly1'. Using the type defined in 'assembly'.

이 경고는 소스 파일(file_2)에 있는 형식이 file_1에 있는 가져온 네임스페이스와 충돌할 때 발생합니다. 이 경우 컴파일러에서는 소스 파일에 있는 형식을 사용합니다.

예제

// CS0437_a.cs
// compile with: /target:library
namespace Util 
{
   public class A {
      public void Test() {
         System.Console.WriteLine("CS0437_a.cs");
      }
   }
}

다음 샘플에서는 CS0437 경고가 발생하는 경우를 보여 줍니다.

// CS0437_b.cs
// compile with: /reference:CS0437_a.dll /W:2
// CS0437 expected
class Util 
{
   public class A { 
      public void Test() {
         System.Console.WriteLine("CS0437_b.cs");
      }
   }
}

public class Test 
{
   public static void Main() 
   {
      Util.A x = new Util.A();
      x.Test();
   }
}