WebWindow icon indicating copy to clipboard operation
WebWindow copied to clipboard

Access Denied alert and crash

Open daniel-scatigno opened this issue 4 years ago • 7 comments

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.' <Cannot evaluate the exception stack trace>

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 avatar Apr 14 '20 23:04 daniel-scatigno

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)

daniel-scatigno avatar Apr 14 '20 23:04 daniel-scatigno

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.

bretehlert avatar Apr 27 '20 00:04 bretehlert

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.

musictopia2 avatar May 24 '20 13:05 musictopia2

was this resolved?

ArieBen avatar Mar 16 '21 11:03 ArieBen

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

Smurf-IV avatar Mar 17 '21 07:03 Smurf-IV

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.

musictopia2 avatar Mar 18 '21 00:03 musictopia2

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

ArieBen avatar Mar 19 '21 10:03 ArieBen