【发布时间】:2017-11-15 19:55:26
【问题描述】:
替代标题: Hololens Windows UWP 构建 (10.0.10586.0) 的 Unity 参考错误? 或..... Unity Hololens 构建可以访问独立构建 DLL 引用?
快速前文:我正在设计一个在 Hololens 上运行的应用程序。游戏在 Unity 中运行良好。它在 PC、Mac 和 Linux 独立平台上构建得非常好,没有错误。
但是,在构建到 Windows 应用商店平台时会出现“缺失”引用的错误。 (缺少引号是因为我已经彻底检查并重新检查我使用了正确的参考,并且它们位于应有的位置)。
尝试构建的初始错误是:
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 应用商店平台,因为它不能使用 Unity 独立构建的某些 DLL?
【问题讨论】:
-
这可能相关也可能不相关,但是您使用的是哪个版本的 Unity?我在使用 5.6 时遇到了 大量 问题,而 5.5 就像做梦一样。
标签: c# .net unity3d dll hololens