Closed AFatNiBBa closed 2 months ago
It works fine for me. No matter Click "break" first or not. And "connection to an Access database" is irrelative.
Here's a thread with regard to the System.Runtime.InteropServices.COMException 0x8007139F error.
Try changing the button handler from this
private void cmdBreak_Click(object sender, EventArgs e)
{
var path = $"{Application.StartupPath}/TestOleDb.accdb";
using var connection = new OleDbConnection($"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={path}"); // The database doesn't even need to exist
try { connection.Open(); }
catch { }
}
to this
private void cmdBreak_Click(object sender, EventArgs e)
{
var path = $"{Application.StartupPath}/TestOleDb.accdb";
using var connection = new OleDbConnection($"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={path}"); // The database doesn't even need to exist
try { connection.Open(); }
catch (OleDbException) { }
}
The handler had a catch
that was meant to handle the case in which the database didn't exist (Which still breaks my custom popup).
I suspect that you don't have the "Microsoft.ACE.OLEDB.12.0" provider installed and that catch
was handling that exception too.
Now the program should crash if you don't have it installed.
I've tried "Microsoft.ACE.OLEDB.16.0" and "Microsoft.JET.OLEDB.4.0" too, but they don't seem to break the webview
Tried catch the exception. Click Break -> click Continue to ignore the error -> Click Popup -> New form with google page loaded. If you take an ETW trace of the repro, we could know more about that failed. How to take ETW trace: https://github.com/MicrosoftEdge/WebView2Feedback/blob/main/diagnostics/etw.md
I started the trace, clicked "Break", clicked "Popup" and then stopped the trace. To minimize interferences I ran the .exe directly without Visual Studio, I think it is worth to notice that this time the program didn't immediately crash after the error, my CUSTOM popup window showed up without anything inside and the STANDARD popup window showed up with the requested page
ETW traces can contain sensitive information, if you're concerned with sharing one publicly in a GitHub issue, you can ask the WV2 developer you're working with for an email address to send to them privately
This would be preferred
You can send the trace to wangsongjin@microsoft.com
@AFatNiBBa From your traces, the WebView2.EnsureCoreWebView2Async(wv.CoreWebView2.Environment)
failed for incompatible DPI awareness. The new popup window has different DPI value compared with existing wv.CoreWebView2 you've created. While I have no clue why open a connection to access database could cause this mismatch on your testing environment.
More Info from the trace:
Existing: DPI_AWARENESS_UNAWARE
New: DPI_AWARENESS_SYSTEM_AWARE
DPI_AWARENESS enumeration (windef.h)
We managed to fix the issue in an unforgivable manner by just forcing a connection BEFORE the first WebView2
was created.
We haven't found a way to prevent the change in DPI awareness, but now it doesn't happen during the life cycle of the WebView2
at least
try
{
using (var conn = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0"))
conn.Open();
}
catch { }
What happened?
I'm trying to make a custom window for popups, but if I open a connection to an Access database and THEN open a popup window,
WebView2.EnsureCoreWebView2Async()
throws aCOMException
saying:Importance
Important. My app's user experience is significantly compromised.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
124.0.2478.97
SDK Version
1.0.2478.35
Framework
Winforms
Operating System
Windows 11
OS Version
22631.3593
Repro steps
If you click only the "Popup" button it will work
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
Don't know
Last working version (if regression)
No response