Compiler Error CS0471
TOC
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Compiler Error CS0471

The method 'name' is not a generic method. If you intended an expression list, use parentheses around the < expression.

This error is generated when your code contains an expression list without parentheses.

The following example generates CS0471.

// CS0471.cs
// compile with: /t:library
class Test
{
    public void F(bool x, bool y) {}
    public void F1()
    {
        int a = 1, b = 2, c = 3;
        F(a<b, c>(3));    // CS0471
        // To resolve, try the following instead:
        // F((a<b), c>(3));
    }
}
Show:
© 2016 Microsoft