Search Unity

UWP, AssetBundles and StreamingAsset result in SecurityException

Discussion in 'VR' started by VincentAtOpuscope, Aug 28, 2018.

  1. VincentAtOpuscope

    VincentAtOpuscope

    Joined:
    Sep 7, 2017
    Posts:
    13
    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 :
    Code (CSharp):
    1.                 try
    2.                 {
    3.                     Debug.Log($"Load asset bundle from {file.FullName}");
    4.                     AssetBundle assetBundle = AssetBundle.LoadFromFile(file.FullName);
    5.                     if (null == assetBundle)
    6.                     {
    7.                         Debug.LogWarning($"Fail to load asset bundle from {file.FullName}");
    8.                         continue;
    9.                     }
    10.                     module = assetBundle.LoadAsset<AssetBundleModule>(Services.MODULE_NAME);
    11.                     if (null == module)
    12.                     {
    13.                         Debug.LogWarning($"Fail to get {nameof(AssetBundleModule)} from {file.Name}");
    14.                         continue;
    15.                     }
    16.                     module.AssetBundle = assetBundle;
    17.                 }
    18.                 catch (Exception e)
    19.                 {
    20.                     Debug.LogException(new Exception($"Error occurs during analyse of: {file.Name}", e));
    21.                     continue;
    22.                 }
    23.                 Debug.Log($"Found {module} from {file.Name}.");
    24.  
    The first log returns :
    #### are some obfuscations.

    Did you have any idea or lead to avoid the security exception?
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,674
    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".