I'm currently trying to load files from the documents folder on the HoloLens using StorageFolder to get the path to the documents folder of the current user. I need this so the user is able to upload files from the device portal and use them inside the Unity application. The only problem is that I can't build my projects anymore from Unity unless I comment out all the methods that use Windows.Storage and the using statement. So my question is, is there something I can do so it doesn't run a piece of code when I build the project inside Unity but does run when I deploy/build my solution to the HoloLens. Or is there another way to get the Documents folder of the current user that works with Unity? The solution provided by HoloSheep on the HoloLens forums over here doesn't work as I'm still getting the same errors while building.
Hi @mverboogen, If sounds like you need to wrap your code in a windows store app platform specific define. Please take a look at the following documentation for more information. https://docs.unity3d.com/550/Documentation/Manual/windowsstore-scripts.html
Hi @BrandonFogerty I got it working, thank you. Just a question. Is Unity going to add the DocumentsLibrary to the capabilities options in the Player Settings? Thankfully it doesn't remove it from the manifest file if I build over an existing build so it isn't really a problem but it would be nice.