나는이 작업을 수행 할 수 있지만,이 오류가 점점 : 여기 말한다 몇 가지 답변을 보았다.NET 2.0의 확장 메서드 사용?
Error 1 Cannot define a new extension method because the compiler required type 'System.Runtime.CompilerServices.ExtensionAttribute' cannot be found. Are you missing a reference to System.Core.dll? [snipped some path stuff]
을, 당신이 자신을 속성 정의해야합니다.
어떻게하면됩니까?
편집는 :
[AttributeUsage (AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)]
public sealed class ExtensionAttribute : Attribute
{
public static int MeasureDisplayStringWidth (this Graphics graphics, string text)
{
}
}
아니요; 당신은 * 두 클래스가 필요합니다; 속성에 대해 하나; 하나의 확장 방법 (들); 업데이트됩니다. –