mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-04 05:34:51 +00:00
Error accessing local resources #516
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SimonSchoeni on GitHub (Jun 18, 2020).
Originally assigned to: @GregorBiswanger on GitHub.
Hello!
I'm currenlty using to Electron.NET to host an ASP MVC application. This application should be capable of displaying videos.
The videos are imported using the
file:///c:/local.../format.Whenever I try to access the video chromium tells me that it is not able to load the local resource: "Not allowed to load local resource: file///c:/local.../"...
When starting up electron, it uses the following options:
var options = new BrowserWindowOptions() { WebPreferences = new WebPreferences() { WebSecurity = false } }; await Electron.WindowManager.CreateWindowAsync(options);As far as I understand this, the turned off WebSecurity feature should allow the underlying chromium to load local resources.... Is there anything else I may have forgotten to check?
@GregorBiswanger commented on GitHub (Jun 18, 2020):
It should normally be sufficient to just deactivate WebSecurity. Possibly. do you want to access a directory without direct access? Have you already run the Electron app as admin? For test only? Did you test the path without an electron?
I would always have the path put together by tools so that it remains a cross-platform.. Use
Path.Combine..@SimonSchoeni commented on GitHub (Jun 19, 2020):
Hi!
I have access to the directories since I used Electron to save data in the same directory.
I didn't really bother to run electron as admin since it should not be required since I'm able to store data to the directory.
I opened the file:/// link in chrome and I saw the file.
Thanks for the advice, I already use Path.Combine etc. :)
BR Simon
@GregorBiswanger commented on GitHub (Mar 28, 2023):
🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉
With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!