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 With c# and Nuget packages in visual studio
Dear WHDF community,
I am playing around with unity and the Microsoft HoloLens because I am interested and wanted to use an import from Nuget. Unfortunately this import never completes and says:
Severity Code Description Project File Line Suppression State
Warning CS0618 'ApplicationView.SuppressSystemOverlays.set' is obsolete: 'Use the TryEnterFullScreen method and IsFullScreenMode property instead of SuppressSystemOverlays. For more info, see MSDN
Are Unity processed scripts compatible with VS 2015 R3 and nuget packages? And if yes, How do you do it?
Kr,
Tvt
Best Answer
-
Optionsjames_ashley ✭✭✭✭
@Tvt,
Unity scripts and UWP are not always 100% compatible. Unity is using .NET 3.5 while UWP is using .NETCore. There's some info in working with Nuget packages in Visual Studio while building from Unity here. While this sometimes works, it isn't optimal since it's a bit of a hack. You're depending on Unity exports not overwriting your Visual Studio settings.
Additionally, though, not all Nuget packages are UWP compatible -- some are written for .NET. If you are getting the error above when you are just trying to import the package, then that's probably your problem and there's no easy fix unless the package publisher has a version compatible with .NETCore.
James Ashley
VS 2017 v5.3.3, Unity 2017.3.0f3, MRTK 2017.1.2, W10 17063
Microsoft MVP, Freelance HoloLens/MR Developer
www.imaginativeuniversal.com5
Answers
Are you using the solution that unity exports after the publish? I had to add my nugets to the solution after the publish from unity.
@JD_Holo_Dev I Do this after I build, is that what you mean?
When I want to add something from Microsoft let's say for example, Azure it doesn't import. What did you import? Maybe I can test that out to see if the things I tried are just incompatible
@Tvt,
Unity scripts and UWP are not always 100% compatible. Unity is using .NET 3.5 while UWP is using .NETCore. There's some info in working with Nuget packages in Visual Studio while building from Unity here. While this sometimes works, it isn't optimal since it's a bit of a hack. You're depending on Unity exports not overwriting your Visual Studio settings.
Additionally, though, not all Nuget packages are UWP compatible -- some are written for .NET. If you are getting the error above when you are just trying to import the package, then that's probably your problem and there's no easy fix unless the package publisher has a version compatible with .NETCore.
James Ashley
VS 2017 v5.3.3, Unity 2017.3.0f3, MRTK 2017.1.2, W10 17063
Microsoft MVP, Freelance HoloLens/MR Developer
www.imaginativeuniversal.com
@james_ashley thanks! You would hope that the MS packages would be compatible with their own product but I will that this as the solution and think of something else.
Nuget is a provider for open source solutions so there's less control there. It's the price we pay for getting free code.
James Ashley
VS 2017 v5.3.3, Unity 2017.3.0f3, MRTK 2017.1.2, W10 17063
Microsoft MVP, Freelance HoloLens/MR Developer
www.imaginativeuniversal.com
@james_ashley Very true! Was just hoping the HoloLens would work with Azure easily but it doesn't seem that way. Will find a way though