UWP, AssetBundles and StreamingAsset result in SecurityException

Hello,

I try to load an AssetBundle from the StreamingAssets folder in an UWP application (with an Hololens). When I call AssetBundle.LoadFromFile, application throws :

Here is the relevant part of the code :

                try
                {
                    Debug.Log($"Load asset bundle from {file.FullName}");
                    AssetBundle assetBundle = AssetBundle.LoadFromFile(file.FullName);
                    if (null == assetBundle)
                    {
                        Debug.LogWarning($"Fail to load asset bundle from {file.FullName}");
                        continue;
                    }
                    module = assetBundle.LoadAsset<AssetBundleModule>(Services.MODULE_NAME);
                    if (null == module)
                    {
                        Debug.LogWarning($"Fail to get {nameof(AssetBundleModule)} from {file.Name}");
                        continue;
                    }
                    module.AssetBundle = assetBundle;
                }
                catch (Exception e)
                {
                    Debug.LogException(new Exception($"Error occurs during analyse of: {file.Name}", e));
                    continue;
                }
                Debug.Log($"Found {module} from {file.Name}.");

The first log returns :

are some obfuscations.

Did you have any idea or lead to avoid the security exception?

It’s not loading asset bundles that throws exception. Loading the asset bundle will instantiate objects from that bundle, and will in result calling “Awake” and “Start” methods on the scripts on those objects.

The script that results in the exception is called “Opuscope.Core.Bootstrap” and it’s in “opuscore.dll”.