So I am working on porting the Skeleton Dude starter kit I built to Windows Phone from Windows 8 Store and ran into the following problem…
“Error building Player: Exception: Error: method `System.Byte System.IO.File::ReadAllBytes(System.String)` doesn’t exist in target framework. It is referenced from Assembly-CSharp.dll at System.Byte NGUITools::Load(System.String).”
If you click on the error, it doesn’t navigate you anywhere useful. Luckily after a few scans through the NGUI source code the issue is easy enough to find. Look for the block of code in NGUITools.cs around line 769.
/// Load all binary data from the specified file.
staticpublicbyte Load (stringfileName)
#if UNITY_WEBPLAYER || UNITY_FLASH || UNITY_METRO
if (!NGUITools.fileAccess) returnnull;
Simply change the pre-compilation directive to the following check:
#if UNITY_WEBPLAYER || UNITY_FLASH || UNITY_METRO || UNITY_WP8