Program Issues Going From Unity To HoloLens - Cannot convert from 'string' to 'System.IO.Stream'

寵の児 提交于 2019-12-02 01:47:49

I agree with the others, this is likely caused by a diffence between mono in the editor and the .net that you are compiling with to get a UWP application. Try this instead:

using(StreamReader sr = new StreamReader(new FileStream(Application.dataPath + metadata, FileMode.Open)))

This should be legal mono and .net code.

The API differs in some cases between Unity Mono and .NET on UWP. It could be the StremReader(string) ctor is missing from the UWP version.

For instance, I had a case where Delegate.CreateInstance works in Editor but fails on Hololens and requires a different version.

You can wrap things in macros or use the one UWP requires.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!