Compiler Error CS0410
No overload for 'method' has the correct parameter and return types
This error occurs if you try to instantiate a delegate with a function that has the wrong parameter types. The parameter types of the delegate must match the function that you are assigning to the delegate.
Example
The following example generates CS0410:
// CS0410.cs
// compile with: /langversion:ISO-1
class Test
{
delegate void D(double d );
static void F(int i) { }
static void Main()
{
D d = new D(F); // CS0410
}
}
Note
This compiler error is no longer used in Roslyn. The previous example generates CS0123 when compiled with Roslyn.
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for