SteveSandersonMS / WebWindow

.NET Core library to open native OS windows containing web UI on Windows, Mac, and Linux. Experimental.
Apache License 2.0
1.99k stars 215 forks source link

Access Denied alert and crash #103

Open daniel-scatigno opened 4 years ago

daniel-scatigno commented 4 years ago

Hello, I'm ruinning the sample application HelloWorld and when the program starts it shows a message "Access Denied" image

After i Hit ok the follow exception is thrown: Exception has occurred: CLR/System.AccessViolationException An unhandled exception of type 'System.AccessViolationException' occurred in WebWindow.dll: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

I'm running Under Windows 10 Pro Version 10.0.18363 Build 18363 I have installed Microsoft Edge Version 81.0.416.53 (Official build) (64-bit)
daniel-scatigno commented 4 years ago

Well, this have something to do with dotnet permissions, If I run the application by executing the exe file it works fine, if I issue a dotnet HelloWorld.dll it doesn't I think dotnet is launching it with some weird permissions, it's not creating a folder inside the application (The one the browser uses to store things)

bretehlert commented 4 years ago

In my experience an "Access is denied" error on Windows is caused by the failed creation of the WebView2 userDataFolder as described by https://github.com/SteveSandersonMS/WebWindow/issues/100

When you launch the program using dotnet it probably tries to create a folder next to the dotnet.exe which you should not have permissions to do.

musictopia2 commented 4 years ago

I tried to create the exe to run. I even tried to do a publish and run it. Both still gave the access denied. I wish there was a way to fix this because I really wanted a way to run native apps with blazor and not just go to a webpage.

ArieBen commented 3 years ago

was this resolved?

Smurf-IV commented 3 years ago

I "resolved it" temporarily, by installing into the users AppData. Not ideal, but it allows the WebView to "do its thing". Will wait for the WebView to start using ProgramData properly, as has been requested in others who have raised this issue

musictopia2 commented 3 years ago

There is a brand new project that was based on this one here https://www.tryphotino.io/ I tried this one and did not run into any problems. Was able to run the sample project with no problems on windows desktop. Its a good temporary solution until .net 6 comes out.

ArieBen commented 3 years ago

yes very interesting and it looks versatile too, looking into it... thanks a lot for the input.