- Home /
Why is Assembly-UnityScript.dll failing at windows certifiction?
Hi,
I am building a game to Windows store, I choose x86 no ARM in the Visual Studio build configuration, using Unity 4.5 to build the Visual Studio C# solution. All is well, I can even run the game from the Visual Studio IDE but when I use the windows certification toolkit it fails on:
FAILED Supported APIs • Error Found: The supported APIs test detected the following errors: ◦API System.IO.FileStream in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. Assembly-UnityScript.dll calls this API. ◦API System.IO.FileInfo in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. Assembly-UnityScript.dll calls this API. ◦API System.Threading.ThreadStart in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. Assembly-UnityScript.dll calls this API. ◦API System.IO.File in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. Assembly-UnityScript.dll calls this API. ◦API System.IO.FileInfo.#ctor(System.String) in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. Assembly-UnityScript.dll calls this API. ◦API System.IO.FileInfo.get_Exists in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. Assembly-UnityScript.dll calls this API. ◦API System.IO.FileStream.Seek(System.Int64,System.IO.SeekOrigin) in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. Assembly-UnityScript.dll calls this API. ◦API System.IO.FileStream.Read(System.Byte[],System.Int32,System.Int32) in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. Assembly-UnityScript.dll calls this API. ◦API System.IO.FileStream.Write(System.Byte[],System.Int32,System.Int32) in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. Assembly-UnityScript.dll calls this API. ◦API System.Threading.ThreadStart.#ctor(System.Object,System.IntPtr) in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. Assembly-UnityScript.dll calls this API. ◦API System.Threading.Thread.#ctor(System.Threading.ThreadStart) in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. Assembly-UnityScript.dll calls this API. ◦API System.Threading.Thread.Start in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. Assembly-UnityScript.dll calls this API. ◦API System.Threading.Thread.Sleep(System.Int32) in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. Assembly-UnityScript.dll calls this API. ◦API System.Threading.Thread.Abort in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. Assembly-UnityScript.dll calls this API. ◦API System.IO.File.ReadAllBytes(System.String) in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. Assembly-UnityScript.dll calls this API.
Every error relates to Assembly-UnityScript.dll... if I remove this assembly the certification passes but then I do not see any menus in the game... so I need this .dll. What do I do to make it pass the certification when submitting to windows store?
This seems a bit odd, I mean it build s and runs local! but why fail it there?
Cheers, Kim
Answer by scottharber · Jun 17, 2014 at 04:53 PM
It's because you're using the FileStream class. The wording in the error message is a bit tricky, it's caught me out before too.
The supported APIs test detected the following errors: ◦API System.IO.FileStream in MSCORLIB, PUBLICKEYTOKEN=B77A5C561934E089 is not supported for this application type. Assembly-UnityScript.dll calls this API.
FileStream isn't supported for Windows 8 Store apps. If you're using FileStream to do game saves or to save config data, use PlayerPrefs instead (it's a form of file i/o with a cross-platform wrapper around it).
$$anonymous$$any thanks the info, I have searched through all my .JS or . CS script but cannot find any reference to this.. I am using PlayerPrefs so it should be ... how do I know where in my source the problem lies, the above info foes not mejntion at all of the location/script in question which sucks?
All your (unityscript) scripts get compiled into this assembly, so the source of the error is specified as specific as it can get.
$$anonymous$$eep in $$anonymous$$d that it doesn't matter if you actually use a certain script / class or not. It's compiled into your assembly anyways. So you have to check all scripts you have inside of your project.
You can use ILSpy to decompile your assembly into C# and search for references to FileStream and / or FileInfo
Ok thanks Bunny83, interesting is that I have windows 8 and I can run it fine on my own machine, only the certification process complains about these...
Your answer
Follow this Question
Related Questions
Unity fails to load System.Net.Http script assembly 0 Answers
4.6 UI Image bug on some Windows 8 and 8.1 0 Answers
Failed loading fbx Importer 3 Answers
cant run the apk in my android phone 0 Answers
Unity web player setup crashing 1 Answer