Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Extension Methods must be defined on top level static classes, 'name' is a nested class.
Extension methods cannot be defined in nested classes.
Example
The following example generates CS1109 because the class Extension is nested inside the class Out:
// cs1109.cs
public class Test
{
}
static class Out
{
static class Extension
{
static void ExtMethod(this Test c) // CS1109
{
}
}
}