App crashes when using Application.OpenURL with a local file

645 views Asked by At

Here's my C# code on Hololens:

Application.OpenURL("file://"+ Path.Combine(Application.streamingAssetsPath, "file.pdf"));

This is supposed to open Microsoft Edge with the URL "file://C/Data/.../file.pdf" But the app crashes when running this code.

It doesn't crash with any other HTTP URLs though.

How can I let Edge know I want to open a local file?

1

There are 1 answers

0
obywan On

Try path like:

file:///C:/

not

file://C/