-
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
Failure to locate/load 'WebView2Loader.dll' when '#' or non-english characters in the path #1236
Comments
Hey @leodin61 - thanks for the bug report! There have been some minor changes to where and how the WebView2Loader.dll is loaded - would you mind trying a newer SDK package to see if that resolves the issue? If not I'm happy to put this bug on our backlog to take a closer look. |
@champnic In my case, I used this path: |
@champnic |
Thanks for the pointer! If that's the issue then I expect this affects all of our SDKs. I've added this bug to our backlog to try and fix. |
@champnic [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
public static extern int AddDllDirectory(string lpPathName); And also: public static void AddEnvironmentPaths(IEnumerable<string> paths)
{
var path = new[] {Environment.GetEnvironmentVariable("PATH") ?? string.Empty};
string newPath = string.Join(Path.PathSeparator.ToString(), path.Concat(paths));
Environment.SetEnvironmentVariable("PATH", newPath);
} I hoped that somehow it will pick it using a relative path that does not depend on non-English chars. |
Hey @gileli121 - Can you try using |
I've got the fix getting checked in now - I'll let you know when it's available. Thanks! |
@champnic How did you fixed it? |
When we were calculating the path to the WebView2Loader.dll in our code it was getting put through a Ya, sounds like |
@champnic |
Hey @gileli121 - The fix will ship with the next prerelease package (it unfortunately missed the recent prerelease), which will probably be in early January. Thanks! |
This is now fixed in the 1.0.1133-prerelease SDK. Thanks! |
I have the same issue. Once I moved the .exe out of the debug/release folder this message shows. Very weird since there is no such .dll in the first place in the debug/release folders. Any ideas where I can get it? |
I take one comment back, it seems the .dll is deployed to "runtimes\win-x86\native". |
Hey @Mecanik - Your app needs some WebView2 SDK files shipped with it to function properly. There should be some helpful details here: |
Description
When client app is running in a folder containing "#" character in its name, i.e. "C:\Projects\Temp\Debug #317\test.exe"
invoking CoreWebView2Environment.GetAvailableBrowserVersionString() throws:
{"Unable to load DLL 'WebView2Loader.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"}
Data: {System.Collections.ListDictionaryInternal}
HResult: -2146233052
HelpLink: null
InnerException: null
Message: "Unable to load DLL 'WebView2Loader.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"
Source: "Microsoft.Web.WebView2.Core"
StackTrace: " at Microsoft.Web.WebView2.Core.CoreWebView2Environment.GetAvailableCoreWebView2BrowserVersionString(String browserExecutableFolder, String& versionInfo)\r\n at Microsoft.Web.WebView2.Core.CoreWebView2Environment.GetAvailableBrowserVersionString(String browserExecutableFolder)\r\n at Nuance.Dma.View.WebView2Ext.IsRuntimeInstalled() in C:\.....\WebView2Ext.cs:line 63"
TargetSite: {Int32 GetAvailableCoreWebView2BrowserVersionString(System.String, System.String ByRef)}
TypeName: ""
Loader lib confirmed to be in place ( C:\Projects\Temp\Debug #317\x86\WebView2Loader.dll )
Removing "#" from the folder name works fine.
Version
SDK: WebView2 v1.0.705.50 (WPF)
Runtime: evergreen runtime "90.0.818.49"
Framework: WPF
OS: Win10
Repro Steps
AB#37110283
The text was updated successfully, but these errors were encountered: