Skip to content

[Blazor] Discourage use of DotNet.invokeMethod and DotNet.invokeMethodAsync #48396

@MackinnonBuck

Description

@MackinnonBuck

The DotNet.invokeMethod and DotNet.invokeMethodAsync APIs currently throw when more than one interactive runtime is present. We should be encouraging developers to replace usage of these methods with DotNetObjectReference method invocations so that JS->.NET interop works regardless of which combination of .NET runtimes are available.

We should consider logging a warning during development if we detect usage of DotNet.invokeMethod or DotNet.invokeMethodAsync.

Metadata

Metadata

Assignees

Labels

Pillar: Complete Blazor WebPriority:2Work that is important, but not critical for the releasearea-blazorIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing onefeature-full-stack-web-uiFull stack web UI with Blazor

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions