Unity Hololens (UWP) build throwing errors that offline builds don't?

Alternative names: Unity References Bug for Hololens Windows UWP Builds (10.0.10586.0)? or ..... Unity Hololens Builds have access to offline build DLLs?

Quick preview: I am developing a launcher app on Hololens. The game plays nicely with Unity. It works great for standalone PC, Mac and Linux platforms without errors.

However, when building the Windows Store platform, errors from "missing" references are thrown. (Missing in quotes because I've carefully checked and double-checked that I am using the correct links and that they are located where they should be).

Initial error while trying to build:

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)
{
    ...
}

      

When this error is corrected by commenting out the above function and its associated code, and the attempt is made to create again, these errors come out:

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))
{
    ...
}

      

Links are stored in the appropriate location:

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

      

Links are listed in the header of the scripts:

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;

      

With everything said. I tried:

-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

      

Fight this problem for a full day. I have NuGet pkgs, VS tools for Unity (otherwise known as VSTU), I am using VS2015. I have a complete loss right now. I don’t understand if I can’t build this on the Windows Store platform as it cannot use some DLLs that might be standalone Unity assemblies?

+3


source to share


1 answer


HoloLens apps are limited to using only what's available in the UWP app. Some things will work in the Unity editor, which does not work in HoloLens apps because the unity editor builds mono and not .net. You should limit yourself to just what works in the UWP and they work great in the editor. Even the full set of UWP APIs are not yet available to work with HoloLens.

Full documentation for UWP is here:

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



A subset added specifically for HoloLens is at the bottom of this page:

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

Unfortunately, there is no place that highlights what is not available. The Visual Studio compiler helps you understand what is and what is not.

+1


source







All Articles