MicrosoftEdge / WebView2Feedback

Feedback and discussions about Microsoft Edge WebView2
https://aka.ms/webview2
452 stars 55 forks source link

App closes when calling async methods synchronously #3139

Open vickiez opened 1 year ago

vickiez commented 1 year ago
          Hi, I made simple WPF example where we can reproduce the same exception and finally application closes.  

I think here is problem with binded async method and threading; In my example I just call javascript method in DevTool console : window.chrome.webview.hostObjects.sync.customactions.GetString("aaa") that is binded to :

    [ClassInterface(ClassInterfaceType.AutoDual)]
[ComVisible(true)]
public class CustomActions
{
    public async Task<string> GetString(string str)
    {
        return await Task.Run(() => str);
    }
}

I used last nuget package version 1.0.1462.37. I can share this example. If here is my configuration error please let me know how can properly bind and use asynchronouse method regards :)

Originally posted by @53b4 in https://github.com/MicrosoftEdge/WebView2Feedback/issues/3062#issuecomment-1381484122

AB#43012834

53b4 commented 1 year ago

Hi, when I can expect that problem will be solved ?

regards,

vickiez commented 1 year ago

Hi @53b4, we're still assessing the priority of this issue. We'll let you know when there is an update