MicrosoftEdge / MicrosoftEdge/WebView2Feedback

WPF FileNotFoundException on initialisation

Open
#3,222 19 comments 1 reaction 1 assignee View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Description
Hello!
We're seeing FileNotFoundExceptions occurring a low level (~0.1% of uses) during the initialisation routine. It's not clear from the exception what exactly can't be found.

The users who are getting this exception are also using it without a problem in the same session.

Anyone have any idea what might be happening here?

Thanks!

Version
SDK: 1.0.1518.46
Runtime: 109.0.1518.78
Framework: WPF
OS: Windows 10

Repro Steps
We haven't been able to reproduce this

Additional Context

  • We're currently packaging WebView2Loader.dll at root level and not in runtimes\win-x86\native, though that shouldn't be an issue as CoreWebView2Environment.LoadWebView2LoaderDll() specifically checks the app root level, as well as the runtimes path
  • We're using CoreWebView2Environment.GetAvailableBrowserVersionString() to verify that a user has WebView2 installed on their machine before continuing, which finishes without throwing every time

Stack Trace

System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at Microsoft.Web.WebView2.Core.CoreWebView2Environment.<CreateCoreWebView2ControllerAsync>d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.Web.WebView2.Wpf.WebView2.<>c__DisplayClass33_0.<<EnsureCoreWebView2Async>g__Init|0>d.MoveNext()

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.