[Bug] [S] WebView2Loader.dll is missing in net472 app
See original GitHub issueWhich Version of MSAL are you using ? 4.33
Platform net472
What authentication flow has the issue? Interactive WebView2
Repro 1 WebView2LoaderRepro.zip
- WebView2Library references WebView2 SDK NuGet.
- WebView2Library does specify AnyCPU PlatformTarget explicitly.
- WebView2Library is packed as a NuGet.
- WebView2App references WebView2Library as a NuGet.
- Run WebView2App for net472 target.
Repro 2
- Use NetDesktopWinFormsWAM project.
- Update to reference MSAL NuGet instead of source code project.
- Build, run, do interactive request.
- WebView2Loader error occurs.
Expected behavior WebView2 should show up.
Actual behavior If App targets net472, I see different behavior depending on the PlatformTarget element in the App csproj.
- None specified - BadImageFormatException
- AnyCPU - DllNotFoundException
- x86 or x64 - everything works
Additional context / logs / screenshots
Current workaround is to set PlatformTarget
to either x86 or x64 in the app’s project file.
Related issue in WebView2 repo: Using WebView2 in a WPF Assembly
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
WebView2Loader.dll is missing in net472 app #1091
Exception is thrown when WebView2Loader.dll cannot be loaded. When the library project is referenced as a project, included in solution, ...
Read more >Unable to load DLL 'WebView2Loader.dll' The specified ...
Here in February 2023 I encounter this same DllNotFound error while recently debugging a WPF project that was calling a WebView2 method.
Read more >webview2loader.dll free download
Download webview2loader.dll free! Fix DLL missing error. Solve it yourself or get help using DLL‑files.com Client to fix DLL error automatically.
Read more >Pop-up msg at start saying ....\WebView2 Loader.dll ...
\WebView2 Loader.dll contains an error. Hi. Each time I start windows11 I get a pop-up message C:\Program\Files\WindowsApps\Microsoftteams_22 ...
Read more >Unable to load DLL 'libHarfBuzzSharp' error when using ...
I have some GemBox PDF code in a class library, which works fine when the class library targets .NET framework 4.7.2 (and consequently...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@bgavrilMS Adding PlatformTarget element workaround doesn’t work for us.
Should we exclude WebView2 here for NetFx targets? https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/blob/c25582a72f1dd7f9a3270120c490734d164c4dc0/src/client/Microsoft.Identity.Client/Platforms/Features/WebView2WebUi/WebView2WebUiFactory.cs#L46-L50
NetDesktopWinFormsWAM still doesn’t include the WebView2Loader.dll.
NetCoreWinFormsWAM does include the different WebView2Loader.dll runtimes.
Also for reference: Release notes for WebView2 SDK.
I was not able to reproduce this issue. @pmaytak - could you try to create a simple repro and open a bug on WebView2 team ? Should be sufficient to just try