Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_webView2.CoreWebView2.WebResourceResponseReceived is not invoked #164

Open
WenningQiu opened this issue Dec 13, 2022 · 1 comment
Open

Comments

@WenningQiu
Copy link

My application works fine on my laptop (Windows 10).

When the application runs on my dev VM (Windows Server 2016), the interaction with the Web server and rendering of web pages are all good, and the request and response messages exchanged with the Web server are captured by Fiddler; however, _webView2.CoreWebView2.WebResourceResponseReceived is not invoked.

The version of "Microsoft.Web.WebView2" package is "1.0.1418.22". The runtime version is the same on both machines:
image

        private void CoreWebView2Ready(object sender, EventArgs e)
        {
            _webView2.CoreWebView2.WebResourceRequested += WebResourceRequested;
            _webView2.CoreWebView2.WebResourceResponseReceived += ResponseReceived;
            _webView2.CoreWebView2.ClientCertificateRequested += ClientCertificateRequested;

            _webView2.CoreWebView2.Settings.AreHostObjectsAllowed = false;
            _webView2.CoreWebView2.Settings.IsWebMessageEnabled = false;
            _webView2.CoreWebView2.Settings.AreDefaultScriptDialogsEnabled = false;

            _webView2.Source = new Uri(SsoEndpointUrl);
        }
@WenningQiu
Copy link
Author

The application was deployed to my dev VM using MSI which was missing a dependency DLL. WebView2 started to work normally once the missing DLL was added.

It is weird how a missing DLL could impact WebView2 behavior. The missing DLL, which was written by me, is purely for the application logic and is completely irrelevant to WebView2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant