dotnet / dotnet/maui

[HybridWebView] InvokeDotNet not triggered on .NET 10 projects (works on .NET 9)

Open
#34,065 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area-controls-hybridwebview has-workaround i/regression partner/syncfusion platform/windows regressed-in-10.0.0 s/triaged s/verified t/bug
Dominant language
C#
Stars
23.3k
Forks
2k
Avg merge
1d 14h
Merged PRs (30d)
296

Description

### Description

In a .NET MAUI app using HybridWebView, JavaScript → .NET invocation (via InvokeDotNet) does not trigger on .NET 10 projects. The same codebase works correctly on .NET 9. This breaks JS-to-.NET messaging from the embedded web content.

Note: I’ve attached net 10.0 minimal reproduction repo and a short screen capture demonstrating the behavior.

https://github.com/user-attachments/assets/9fecf9fb-d0f3-4d1e-8e96-46c325f900b0

https://github.com/user-attachments/assets/db2333fd-9826-4e2b-a2b5-bf3591d9f899

### Steps to Reproduce

[HybridWebViewNet10.zip](https://github.com/user-attachments/files/25334412/HybridWebViewNet10.zip)
1. Download the attached sample and open the solution.
2. Restore & build both projects (Net9 and Net10).
3. In the web view, click the “InvokeDotNet” button that triggers InvokeDotNet method from JS.
4. Observe:
.NET 9 project → .NET callback receives the payload and updates the UI/log.
.NET 10 project → No callback received (no UI/log updates).

### Link to public reproduction project repository

_No response_

### Version with bug

10.0.40

### Is this a regression from previous behavior?

Not sure, did not test other versions

### Last version that worked well

9.0.0 GA

### Affected platforms

I was *not* able test on other platforms

### Affected platform versions

_No response_

### Did you find any workaround?

_No response_

### Relevant log output

```shell

```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached HybridWebViewNet10.zip reproduction, restore and build both the .NET 9 and .NET 10 projects, then click the InvokeDotNet button in the web view. Compare the working .NET 9 callback with the missing .NET 10 callback. Done means JavaScript invokes .NET and the callback receives the payload and updates the UI or log in the .NET 10 project.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, javascript
Domain
mobile, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.