컴파일러 경고(수준 1) CS1682
업데이트: 2007년 11월
오류 메시지
'type' 형식에 대한 참조는 'nested type' 안에 중첩된 것으로 되어 있지만 찾을 수 없습니다.
Reference to type 'type' claims it is nested within 'nested type', but it could not be found
이 오류는 다른 참조와 맞지 않는 참조 또는 사용자가 작성한 코드와 맞지 않는 참조를 가져올 경우에 발생합니다. 이 오류는 일반적으로 메타데이터의 클래스를 참조하는 코드를 작성한 다음 클래스를 삭제하거나 정의를 수정하는 경우에 발생합니다.
예제
// CS1682.cs
// compile with: /target:library /keyfile:mykey.snk
public class A {
public class N1 {}
}
// CS1682_b.cs
// compile with: /target:library /reference:CS1682.dll
using System;
public class Ref {
public static A A1() {
return new A();
}
public static A.N1 N1() {
return new A.N1();
}
}
// CS1682_c.cs
// compile with: /target:library /keyfile:mykey.snk /out:CS1682.dll
public class A {
public void M1() {}
}
다음 샘플에서는 CS1682 경고가 발생하는 경우를 보여 줍니다.
// CS1682_d.cs
// compile with: /reference:CS1682.dll /reference:CS1682_b.dll /W:1
// CS1682 expected
class Tester {
static void Main()
{
Ref.A1().M1();
}
}