I started working with the Microsoft HoloLens.
I am completely new to C# programming. So this could be a simple or even stupid question, but I just can't explain it and couldn't find any information about it. I work with Unity 2018.4.21f1 Visual Studio 2019 and the already mentioned HoloLens.
I would like to program an app that opens a FileExplorer where I can select OneDrive from the drop down menu, choose a .obj-file (let's take cube.obj as an example) and this file gets processed and rendered at runtime.
I can use a FileOpenPicker to select a file from OneDrive, but then the following error message appears:
Exception thrown at 0x76C330D2 in APP.exe: Microsoft C++ exception: Il2CppExceptionWrapper at memory location 0x0210C090. DirectoryNotFoundException: Could not find a part of the path "C:\Data\Users\marcu\AppData\Local\Packages\microsoft.microsoftskydrive_8wekyb3d8bbwe\LocalState\OpenFile\cube.obj".
If someone had a similar problem and could help me to solve this one or could give me a hint, I would be very grateful.
UWP apps can only access certain file system locations by default such as ApplicationData
and Package.InstalledLocation
. Unfortunately, you cannot directly access the files in OneDrive through the path.
But you can copy this file from OneDrive to ApplicationData.Current.LocalFolder
by calling the method StorageFile.CopyAsync()
. Because the LocalFolder is the folder where your app can store data freely and be created when your app is installed, you can access this file from LocalFolder by the string path.