- Home /
Windows store app doesn't have permissions to access bundle?
Hi all, I am working on a windows store app intended to be side loaded onto a surface. I have started attempting to use bundles with the application and all works well in the unity editor, but when I build the project out to a windows store app and try to debug through visual studio, the app can't seen to access the bundles due to a permissions error.
Here is the code that the app is using to access the bundle: using UnityEngine; using System.Collections;
public class SimpleLevelLoader : MonoBehaviour {
[SerializeField] string path;
[SerializeField] string sceneName;
IEnumerator Start ()
{
using (WWW www = WWW.LoadFromCacheOrDownload(path, 0))
{
yield return www;
if(!string.IsNullOrEmpty(www.error))
{
Debug.Log (www.error);
yield break;
}
Application.LoadLevel(sceneName);
yield return null;
www.assetBundle.Unload(false);
}
}
}
This is the example code from the unity 5 bundles training and it works fine in the editor. I am passing in an absolute file path for now, just as a test to see if I could get it working. When I try to load the bundle in the windows app while running/debugging in visual studio, I get the following error:
First-chance exception at 0x76DA4598 in Template.exe: Microsoft C++ exception: Concurrency::invalid_operation at memory location 0x0975F354. Error while opening 'file://C:\Users\aharris\Desktop\Spike Projects\Unity AssetBundle Test\Bundles\PC\mytestbundle' - Operation has failed with error 0x80070005: Access is denied.
Do I need to specify some permissions in the app or is there a special folder in the project I need to but the bundle?
I have tried putting the bundle in the built app's Data and Assets folders in the built app's project folder thinking it would have access, but to no avail.
Thanks
Answer by aharris · Jun 03, 2015 at 05:27 AM
I found what the issue was, apparently the built app's Data and Assets folders are not the place for the bundles. Through some debugging, I found that after running in Visual Studio it builds a bin with a separate data folder. Using Application.DataPath showed me the correct directory to put it in, at least for the purposes of running it in VS. Thanks
Your answer
![](https://koobas.hobune.stream/wayback/20220613200359im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Which BuildTarget should use for creating UWP bundles? 0 Answers
Monodevelop-Unity on OSX still requires admin rights to run. 4 Answers
Unity 5.1 adds permission READ_PHONE_STATE automatically 1 Answer
read phone status and identity - after adding facebook SDK 0 Answers
Android Permissions API Version 1 Answer