Blazor

Error CS1061 ‘IJSRuntime’ does not contain a definition for ‘Current’.

Error CS1061 ‘IJSRuntime’ does not contain a definition for ‘Current’.

In ASP.NET Core 3.0.0-preview3, the Microsoft.Interop.JSRuntime.Current has been removed.

@inject IJSRuntime JsRuntime;


@code {
    protected void CallJSMethod()
    {
        JSRuntime.InvokeAsync<bool>("JSMethod");
    }
}

I would suggest you check the below link for better understanding:
https://github.com/aspnet/AspNetCore/issues/8117or

Sumitra Kumari Shaw

An Engineering graduate who Enjoys building things that live on the internet.