编译器错误 CS1105
更新:2007 年 11 月
错误消息
扩展方法必须为静态方法。
扩展方法必须在非泛型静态类中声明为静态方法。
示例
下面的示例生成 CS1105,因为 Test 不是静态方法:
// cs1105.cs
// Compile with: /target:library
public class Extensions
{
// Single type parameter.
public void Test<T>(this System.String s) {} //CS1105
}