Unity Hololens (UWP) 构建会生成 Standalone 构建不会产生的错误?

Unity Hololens (UWP) build generates errors that Standalone builds do not?

备选标题: Unity References Bug for Hololens Windows UWP 构建 (10.0.10586.0)? 或者..... Unity Hololens Builds 可以访问 Standalone Build DLL 引用?

快速 pre-text:我正在为 运行 在 Hololens 上设计一个应用程序。该游戏在 Unity 中运行得非常好。它在 PC 上构建得非常好,Mac & Linux 独立平台没有错误。

但是,在构建 Windows 商店平台时,会出现 "missing" 引用的错误。 (遗漏在引号中,因为我已经彻底检查并重新检查我使用了正确的参考文献并且它们位于它们应该位于的位置)。

尝试构建的初始错误是:

Error building Player because scripts had compiler errors
error: The type or namespace name 'FileSystemEventArgs' could not be found (are you missing a using directive or an assembly reference?)
private void PrototypeFileWatcher_Created(object sender, FileSystemEventArgs e)
{
    ...
}

当通过注释掉上述函数和相关代码来更正此错误并再次尝试构建时,会出现这些错误:

error: The name 'Console' does not exist in the current context
catch (Exception e)
{
    Console.WriteLine(e.Message);
}

error: Argument 1: cannot convert from 'string' to 'System.IO.Stream'
using (StreamReader sr = new StreamReader(path))
{
    ...
}

error: The type or namespace name 'BufferedStream' could not be found (are you missing a using directive or an assembly reference?)
using (BufferedStream bs0 = new BufferedStream(f0))
{
    ...
}

引用存储在适当的位置:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Unity Full v3.5\System.Core.dll

引用列在脚本的标题中:

using UnityEngine;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System;
using UnityEngine.UI;
using UnityEngine.EventSystems;
using System.Threading;

话虽如此。我试过:

-Changing Api Compatibility Level*
-Changing the project solutions net framework
-#if NETFX_CORE using x = WinRTLegacy.x; #else
-#if WINDOWS_UWP using System; #endif
-Trashing the project entirely and rebuilding from scratch
-And lots more

一整天都在为这个问题苦苦挣扎。我有 NuGet pkgs,Unity 的 VS 工具(也称为 VSTU),我正在使用 VS2015。 我现在完全不知所措。我不明白我是否不能将它构建到 Windows Store 平台,因为它不能使用 Unity 独立构建可以使用的一些 DLL?

HoloLens 应用程序仅限于使用 UWP 应用程序中可用的内容。有些东西在 Unity 编辑器中可以工作,但在 HoloLens 应用程序中不起作用,因为 unity 编辑器使用 mono 而不是 .net 构建。你应该限制自己只使用在 UWP 中工作的东西,它们在编辑器中也能正常工作。即使是整套 UWP API 也无法在 HoloLens 上使用。

UWP 的完整文档在此处:

https://docs.microsoft.com/en-us/uwp/api/

专门为 HoloLens 添加的子集位于本页底部:

https://developer.microsoft.com/en-us/windows/mixed-reality/development

遗憾的是,没有地方突出显示不可用的内容。 Visual Studio 编译器将帮助您了解存在的内容和不存在的内容。