An object-oriented programming language developed by Microsoft that can be used in .NET.
Hello @Hal Roenick ,
Thank you so much for sharing your findings.
Since you cannot accept your own answer, I’m posting this issue and its solution to help anyone else who may encounter the same problem.
In addition to the solutions you found, I recommend an additional workaround to help keep your application aligned with standard Windows security practices:
- Managing the installation folder and permissions.
Moving the application to the root of the system drive bypasses Windows security, but it is much safer to keep 32-bit apps in the standard Program Files (x86) folder. You can refer to these code example:
Dim userDataFolder As String = System.IO.Path.Combine(Application.LocalUserAppDataPath, "EBWebView")
Dim environment As Microsoft.Web.WebView2.Core.CoreWebView2Environment = Await Microsoft.Web.WebView2.Core.CoreWebView2Environment.CreateAsync(Nothing, userDataFolder, Nothing)
Await WebView21.EnsureCoreWebView2Async(environment)
- If you ever want to move your DataGridView back to a separate dialog, you absolutely can. When WebView2 turns into Nothing in VB.NET, it is usually because the code accidentally called a "ghost" copy of the form instead of the real one you are looking at. Passing a direct reference of your open form to the new dialog will prevent the control from losing its instance.
Again, thank you so much for sharing your time and experience.
If any part of my explanation helped address your question, I would greatly appreciate it if you could follow the instructions here. This can also help other community members facing similar scenarios.