unity-cognitive-services-demos icon indicating copy to clipboard operation
unity-cognitive-services-demos copied to clipboard

`File' does not exist in the namespace `UnityEngine.Windows'

Open einstyle opened this issue 7 years ago • 2 comments

When imported, two errors:

Assets/Scripts/ImageToEmotionAPI.cs(39,44): error CS0234: The type or namespace name File' does not exist in the namespace UnityEngine.Windows'. Are you missing an assembly reference?

Assets/Scripts/ShowImageOnPanel.cs(28,27): error CS0103: The name `File' does not exist in the current context

How to solve them?

einstyle avatar May 12 '17 13:05 einstyle

Ok, it seems that this can work: In ShowImageOnPanel.cs: #if UNITY_WINRT byte[] fileData = UnityEngine.Windows.File.ReadAllBytes(fileName); #else byte[] fileData = System.IO.File.ReadAllBytes(fileName); #endif

Instead, in ImageToEmotionAPI.cs: #if UNITY_WINRT byte[] bytes = UnityEngine.Windows.File.ReadAllBytes(fileName); #else byte[] bytes = System.IO.File.ReadAllBytes(fileName); #endif

einstyle avatar May 12 '17 13:05 einstyle

how does this work??

Amal-A-U avatar Sep 19 '17 11:09 Amal-A-U