dioxus icon indicating copy to clipboard operation
dioxus copied to clipboard

"The code execution cannot proceed because WebView2Loader.dll was not found."

Open willburden opened this issue 3 years ago • 1 comments

Problem

I'm following the guide at https://dioxuslabs.com/guide/, and recreated the first 'Hello world' example. I compiled it on WSL Ubuntu (targeting Windows) and ran the resultant executable on Windows. The program failed with an error dialog saying The code execution cannot proceed because WebView2Loader.dll was not found. Reinstalling the program may fix this problem.

I already had Microsoft Edge installed, which I believe means I should have WebView. I tried installing WebView using the Evergreen Bootstrapper at https://developer.microsoft.com/en-us/microsoft-edge/webview2/, and it told me I already have it. I also managed to get Windows to reinstall WebView using the Add or Remove Programs settings menu, but this didn't fix the issue.

I'm by no means certain that WSL is the problem, just thought it was worth mentioning.

Steps To Reproduce

Steps to reproduce the behavior on WSL:

  • Follow the steps in the guide to recreate the 'Hello world' example in the Linux filesystem.
  • Run cargo target add x86_64-pc-windows-gnu to enable cross-compiling for Windows.
  • Run cargo build --target x86_64-pc-windows-gnu to compile the program.
  • Copy the target/x86_64-pc-windows-gnu/debug/hello-dioxus.exe file to the Windows filesystem.
  • In Command Prompt, run start hello-dioxus.exe.

Steps to reproduce the behaviour on only Windows (haven't tested this):

  • Follow the steps in the guide to recreate the 'Hello world' example.
  • Run cargo build to compile the program.
  • Run start target/debug/hello-dioxus.exe.

Expected behavior

A window is created with a single line of text saying "Hello world".

Environment:

  • Dioxus version: v0.2.3
  • Rust version: 1.58.1, stable
  • OS info: Compiled on Ubuntu 20.04.4 LTS using WSL. Run on Windows version 10.0.22000 Build 22000.
  • App platform: desktop

Questionnaire

  • [x] I'm interested in fixing this myself but don't know where to start
  • [ ] I would like to fix and I have a solution
  • [ ] I don't have time to fix this right now, but maybe later

willburden avatar Apr 08 '22 17:04 willburden

@willburden you can try this as a drive #345

ar37-rs avatar Apr 09 '22 19:04 ar37-rs