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.
Project can play in Unity Editor Mode but is unable to build for HoloLens
Hello,
I'm currently writting a HoloLens app in Unity. For this, I'm using the latest Unity3D (5.5.0f3) and HoloToolkit (1.5.5.0) versions as of now. I've applied the project settings located in the menu "HoloToolkit>Configure>Apply HoloLens Project Settings" .
On top of that, I am using several external DLLs, among which RestSharp and Manatee.Json. I've put those DLLs in my "Assets/Scripts/_External" folder, using their net35 version each time.
As I've said in the question title, the project runs perfectly during play mode, with 0 warnings. However, when I try to buildthe project, I get several errors :
When building with HoloToolkit default settings : "Compilation Overrides>Use Net Core" is enabled
- The build process fails at the last step. I get 2 large errors mentioning issues like
Error: method 'System.Boolean System.Type::get_IsAbstract()' doesn't exist in target framework. It is referenced from Manatee.Json.dll at T
. Every time there is an error, the issue seems related to this DLL. - I've tried removing every refference to "Manatee.Json.dll". In this case, the build completes, but I then have 380 errors like the following :
Error: type 'System.ComponentModel.DescriptionAttribute' doesn't exist in target framework.
- The build process fails at the last step. I get 2 large errors mentioning issues like
When building with the "Compilation Overrides>None" setting :
- The build process does not start, and I have 4 errors mentioning issues like
Feature 'asynchronous functions' cannot be used because it is not part of the C# 4.0 language specification
. The 2 classes involved are part of HoloToolkit, "MeshSaver.cs" and "GenericNetworkTransmitter.cs" .
- The build process does not start, and I have 4 errors mentioning issues like
I am a bit at loss right now, and can't figure a way to solve my issue.
Best Answer
-
OptionsASerre ✭
@gutia After struggling for a while, and trying every possible setting I could think of, I finally managed to get my project to build by keeping the default "Use Net Core" setting. In Unity, for every external DLL, I applied the following settings :
- "SDK>UWP"
- "ScriptingBackend>Dot Net"
- "Don't Process>Checked"
I'm not sure wether all of those options need to be enabled. I think the key to make it work is the "Don't Process" checkbox.
So, apparently, I've just lost 2 days of debbugging over a simple checkbox This was my 1st time using external DLLs on Unity, so I don't know if this is a common occurence or not. Either way, I learnt it the hard way ...
EDIT: The checkbox seems to be the way to go for RestSharp and Manatee.Json, and any other library not relying on MonoBehaviour. More details in the Unity documentation.
5
Answers
Got exactly same issue just now. Did you figure out a solution?
@gutia After struggling for a while, and trying every possible setting I could think of, I finally managed to get my project to build by keeping the default "Use Net Core" setting. In Unity, for every external DLL, I applied the following settings :
I'm not sure wether all of those options need to be enabled. I think the key to make it work is the "Don't Process" checkbox.
So, apparently, I've just lost 2 days of debbugging over a simple checkbox This was my 1st time using external DLLs on Unity, so I don't know if this is a common occurence or not. Either way, I learnt it the hard way ...
EDIT: The checkbox seems to be the way to go for RestSharp and Manatee.Json, and any other library not relying on MonoBehaviour. More details in the Unity documentation.
Thank you @ASerre! I wasn't able to find this "Don't Process" checkbox in Unity personal edition. Also SDK > Universal 10 (no option for UWP). But setting "Build and Run On" Windows Phone resolved the issue (instead of local machine and windows phone). I assume I should have had this setting earlier, but I am new to Windows Apps...
@ASerre, I'm the creator of Manatee.Json. I'm curious how my library ended up being referenced in a HoloLens project.
Also, as of version 7.0, .netstandard 1.4+ is supported. You may be able to upgrade and eliminate that error.