The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
Unity - missing namespaces
Hi there,
I'm trying to build for Hololens in Unity. It fails and I get a ton of missing namespace errors for basic .net dll's like System, Timers, Thread, etc, that I don't get when simply running the simulator. I made a little test project with a single game object and one-line script to narrow it down. All it does it instantiating a new System.Timers
When I try to build it I get:
Assets\Scripts\TestScript.cs(2,14): error CS0234: The type or namespace name 'Timers' does not exist in the namespace 'System' (are you missing an assembly reference?)
zip file here if you want to have a look: http://puu.sh/rLp4v/76a2f78b21.zip
I'm using:
Unity HoloLens 5.4.0f3-HTP (64-bit)
Win10 SDK 10.0.105862.212
http://puu.sh/rLoPx/01b17a521d.png
build setting:
http://puu.sh/rLpeU/2b5143fcc2.png
Any idea what's going on?
Thanks
Best Answer
-
OptionsHoloSheep mod
@Salmon you will need to use UWP compatible .Net libraries.
For example instead of
System.Timers
try
Windows.UI.Xaml.DispatcherTimer
or if you are doing threading related stuff
Windows.System.Threading
Here is a quote from MSDN about .NET for UWP:
Note that .NET for UWP apps includes a subset of the types provided in the full .NET Framework for each namespace.
HTH
Windows Holographic User Group Redmond
WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
WinHUGR YouTube Channel -- live streamed meetings5
Answers
I've been having the same issue with that CS0234 error too!
Looking forward to the answer on this one...
@Salmon you will need to use UWP compatible .Net libraries.
For example instead of
System.Timers
try
Windows.UI.Xaml.DispatcherTimer
or if you are doing threading related stuff
Windows.System.Threading
Here is a quote from MSDN about .NET for UWP:
HTH
Windows Holographic User Group Redmond
WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
WinHUGR YouTube Channel -- live streamed meetings
Oh I had no idea, thanks I fixed all my errors and now it builds fine