AccessViolation 0xC0000005 was thrown while calling AddHostObjectToScript
See original GitHub issueDescribe the bug
Steps to reproduce the bug
Steps to reproduce the behavior:
- Create a WinUI 3 project (either UWP or Desktop)
- Follow https://docs.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2.addhostobjecttoscript
AccessViolation
was thrown while callingAddHostObjectToScript
Expected behavior
No exception was thrown.
Version Info
NuGet package version: WASDK 1.0, WinUI 3
Windows app type:
UWP | Win32 |
---|---|
Yes | Yes |
Windows 10 version | Saw the problem? |
---|---|
Windows 11 (22000) | Yes |
Insider Build (21322) | Yes |
October 2020 Update (19042) | |
May 2020 Update (19041) | |
November 2019 Update (18363) | |
May 2019 Update (18362) | |
October 2018 Update (17763) | |
April 2018 Update (17134) | |
Fall Creators Update (16299) | |
Creators Update (15063) |
Device form factor | Saw the problem? |
---|---|
Desktop | Yes |
Xbox | |
Surface Hub | |
IoT |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:16 (5 by maintainers)
Top Results From Across the Web
.net - Webview2 AddHostObjectToScript throws Exception ...
Exception thrown at 0x7901179F (Microsoft.Web.WebView2.Core.dll) in WinUI3_1.exe: 0xC0000005: Access violation reading location 0x00000000.
Read more >CoreWebView2.AddHostObjectToScript(String, Object) ...
By default, an exception is thrown when attempting to get the value of a proxy property that doesn't exist on the corresponding native...
Read more >WinRT WebView2注入宿主对象供JS使用【失败记】
从这个Issue AccessViolation 0xC0000005 was thrown while calling AddHostObjectToScript #4377 看来WinRT版的WebView2目前还是有比较多的问题的。
Read more >Call native-side code from web-side code
When developing a WebView2 app, you may encounter a native object ... The AddHostObjectToScript API enables re-use of native-side code by ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah, we’re still waiting on this so we can more easily port the Monaco wrapper over to WinUI 3 without a big work-around.
This API is not yet implemented in the core WebView2 WinRT API.