-
Notifications
You must be signed in to change notification settings - Fork 51
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
[Problem/Bug]: Still Error loading Webview2Loader from UNC path for VSTO add-in #4081
Comments
@Mark-IDB I just tried and see WebView2Loader.dll loading correctly from a UNC path using SDK 1.0.2088.41. I wonder if it has something to do specifically with being a VSTO? |
Hello @champnic , |
As requested by @champnic here is a reproducer that exposes the bug outside of a VSTO. My environment: Windows 11 23H2 fully patched. I can also reproduce at a customer site on Windows Server 2019.
On step 7 nothing will happen - an empty WinForms application opens |
Thanks both! I was able to repro the issue by loading the entire application from a UNC path. In the past we were only testing that the WebView2Loader.dll could be properly loaded from a UNC path, and that seems to be working fine. The issue I'm seeing when the entire app is loaded from UNC is that .NET fails to load Microsoft.Web.WebView2.Winforms.dll. Using Process Monitor I see it trying to load the assembly from the GAC which fails (as expected), and then tries to load from an incorrect UNC path. For example, I see it try to load from: Is that similar to what you are seeing? |
I'm not sure yet whether this is a bug in how .NET looks for assemblies with UNC paths, or if it's something we have control over in the WebView2 package. |
I reached out to the .NET team and they mentioned that they thought that loading binaries from UNC paths was a known issue. I also tried with another Winforms WebView2 app, but this time using .NET 7, and it loaded fine from the local UNC path using As this seems to be a bug in .NET that has been resolved in newer versions, I'm going to close this item as out-of-scope for WebView2. Can you please try with the newer .NET versions? If you are still running into this issue and have checked with Process Monitor that it's some other path or files that's failing to load, please let me know and we can consider looking into it further. Thanks! |
Hi @champnic , I also would like to upgrade to a newer .Net version very much....But this is not possible in a vsto application! You are limited to .Net Framework (and we are using the latest 4.8 version) |
Thanks for the tip on process monitor. I am seeing it searching for webview2loader.dll on all paths in the environment (which is why it is working if the loader file is present in the office install). The last part would be correct (but the Microsoft.Web.WebView2.Core.DLL would not be a directory). The location seems a local search path combined with the actual path. Once again: This is working in 1.0.1030.20! This version also doesn't allow you to specify the location of the webview2loader.dll. The later versions do and the problem starts with these versions. |
@champnic Also, I can not change to .NET 7 as our customer specifically required Framework 4.7.1 to use. |
Reopening again for the VSTO issue. @ThomasReinhardt trying your app (though I removed the args piece of it and just have it always navigate to a specific url) it worked fine even from a UNC path and using .NET framework. Not sure what's going wrong on your machine but I'd recommend debugging it and seeing if there's an exception being thrown or other info. The procmon log you shared also seemed to indicate that the WebView2Loader.dll was being located correctly and wasn't showing the mangled paths that I saw (which required a dollar sign to be in the UNC path). |
I just installed a complete vanilla Server 2019 on a physical laptop. Only change I have done to the installation is installing the WebView2 Evergreen Standalone Installer. The error is still reproducible. There are no exceptions (there is a try catch in Form1.Navigate () but for completeness I added one in Program.Main() ). No events in EventViewer or anything. I am currently installing all windows updates but I do not expect any changes. |
@ThomasReinhardt Yes, just set the uri in the constructor. Can you try stepping through the code and verify that the expected code is getting hit? You can also add WebView2.CoreWebView2InitializationCompleted handler and verify that args.IsSuccess is true, and if not, check what the error is. |
@Mark-IDB I've been trying to get the add-in to load from a UNC but have been unsuccessful so far. I'm not sure why as the regkeys and files seem to be loaded fine in Process Monitor. I've reached out to the Outlook team and am waiting to hear back. Are your repro steps complete for how you are changing the registry to successfully load your add-in from UNC? |
Hi @champnic , [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\vsto runtime Setup\v4] |
A similar issue with UNC though not with web forms scenario. My VS 2022 DLL was just compiled with WebView SDK 1.0.2194 A shortcut with a UNC path to the same local folder encounters a failure. That shortcut has We are using local files. There is no web server in play. The '1' indicates 'error' per Where can I find more information on the cause of the error? |
@Mark-IDB Thanks - I was able to repro the issue with that and I'm now debugging. @reynoldslabware Can you open a separate issue for that? It sounds like a different problem if the dlls are loading fine. |
Thank you. I will open a separate issue. Is was soooo similar that I wanted to start herein and fork if requested. Much appreciated |
@Mark-IDB I've root caused the issue and I'm testing a fix now :) |
Great! :-) |
Microsoft.Web.WebView2.1.0.2226.zip |
FWIW |
@champnic unfortunately it does not solve my issue. I added the init listener as you suggested last week. Local execution works normal, calling over UNC does not:
|
@reynoldslabware That's expected, as your issue seems to be separate from this one. @ThomasReinhardt That also looks like a separate issue. 0x800700AA "Resource is in use" can be due to having trouble connecting to an existing msedgewebview2.exe runtime instance if one is already running. Can you make sure there are no running WebView2 processes related to you app before running it, so you're starting from a clean slate? Can also see: #2446 |
@champnic I can confirm it is working now :) |
@champnic There are no processes that relate to WebView2 and/or my test program. The error is 100% reproducible - even directly after a reboot on a completely fresh Server 2019 installation. Tested with the Administrator user. Also, I don't think #2446 applies here since there is only a single invocation and no reuse. After more testing I think the error might just be a misleading error code. When I gave "Full Access" to "Everyone" on the share the test seems to work. Have to check at the customer and of course full access is not a solution but at least there is progress. @champnic can you please check again with just "read" permissions on the share? |
@Mark-IDB Thanks for verifying! @ThomasReinhardt I think that might be expected then. You'll need "Execute" permissions to correctly allow loading and running code from the share. |
The fix has been checked in and should be available in the next pre-release SDK. |
@champnic I have done some tests and whatever I do the application only works if the calling user has write permissions. To be more precise: my share has to have "change" and "read" permissions in addition to "create files/write data" and "create folders/append data" along with read + execute permissions on the filesystem. That is not acceptable from a security point of view (write permissions on a share). I suspect that is kind of by design for the evergreen runtime. I have to re-check with the fixed version runtime. |
Hm, I suspect the write permissions may be coming from the User Data Folder. Are you setting the User Data Folder somewhere local, or is it defaulting to the share? Can you try using a local UDF if you aren't, like a folder in C:\temp? |
@champnic Thanks so much! That did the trick! |
@ThomasReinhardt Glad to hear it's working now! |
What happened?
I have just upgraded the webview2 sdk to the latest release (1.0.2088.41).
The problem reported earlier in bug #3465 are still present in a vsto project.
See the reproduction in #3465 to encounter the bug.
We still have to use 1.0.1020.30 to use our software without problems.
Importance
Blocking. My app's basic functions are not working due to this issue.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
118.0.2088.46
SDK Version
1.0.2088.41
Framework
Winforms
Operating System
Windows 10
OS Version
10945.3570
Repro steps
See all steps described in #3465
Regression
Regression in newer SDK
Last working version (if regression)
1.0.1020.30
AB#47129343
The text was updated successfully, but these errors were encountered: