error CS1503: Argument 2: cannot convert from 'void' to 'Microsoft.AspNetCore.Components.EventCallback' on an @onclick line means the method was called instead of passed. Write @onclick="Save", without the parentheses, and the build passes.

If you need to pass an argument, wrap the call in a lambda: @onclick="() => Save(id)". Either way the attribute gets a method to call later, not the result of calling it now.

The error

...\Ev\Components\Pages\Home.razor(4,19): error CS1503: Argument 2: cannot convert from 'void' to 'Microsoft.AspNetCore.Components.EventCallback' [...\Ev\Ev.csproj]
...
    0 Warning(s)
    1 Error(s)

Line 4, column 19 is the value of the @onclick attribute in the page below. The message names neither the button nor the Save method, so the quickest way to find the mistake in a larger page is to open the file at that line and column and look for parentheses after the handler name.

Why it happens

The page that failed:

@page "/"
@rendermode InteractiveServer

<button @onclick="Save()">Save</button>
<p>@status</p>

@code {
    string status = "";

    void Save()
    {
        status = "Saved for Maria Garcia";
    }
}

The value of @onclick is a C# expression. Save is a method group that can become an event handler; Save() is a call, and its type is the method's return type, void. The compiler reports that it cannot turn void into the EventCallback the attribute expects. The page has no method call with two arguments on that line, so "Argument 2" does not match anything you wrote; the line and column are the part of the message to follow.

The fix

@page "/"
@rendermode InteractiveServer

<button @onclick="Save">Save</button>
<p>@status</p>

@code {
    string status = "";

    void Save()
    {
        status = "Saved for Maria Garcia";
    }
}

Removing the two parentheses was the only change, and dotnet build -nologo then reported 0 Warning(s) and 0 Error(s). The check was the build; the button was not clicked in a browser.

For a handler that takes an argument, parentheses are needed, so the call goes inside a lambda that the attribute can hold until the click. A second page in the same project used that lambda form, and dotnet build -nologo again reported 0 Warning(s) and 0 Error(s):

<button @onclick="() => Save(id)">Save</button>
<p>@status</p>

@code {
    int id = 42;
    string status = "";

    void Save(int customerId)
    {
        status = "Saved customer " + customerId;
    }
}

How it was reproduced

A fresh project from dotnet new blazor -o Ev --interactivity Server on .NET SDK 10.0.403 (ASP.NET Core 10.0.14 runtime), with the home page replaced by the page above, built with dotnet build -nologo before and after the change. No package was added.

Frequently asked

Why does onclick give cannot convert from void to EventCallback?
The attribute value calls the method, Save(), instead of naming it, Save. The call returns void, and void cannot become the EventCallback the attribute expects.
How do I pass a parameter to an onclick handler in Blazor?
Wrap the call in a lambda, for example () => Save(id), so the attribute receives a function to run on the click. That form built with 0 errors in the test.
What is Argument 2 in the Blazor CS1503 error?
It does not match anything written on the page: the line had no call with two arguments. The line and column in the message, 4 and 19 in the test, point at the attribute value.

More decoded errors in the Fixes category. Handlers, callbacks and binding are explained in data binding and events in Blazor.