I'm trying to include a second UWP Visual Studio project into a Unity project for the Microsoft Hololens. I essentially want this other project to begin running when the Unity project begins (I also need it to be able to send messages to my project). I have VS 2015 Update 3 and Unity 5.4.0 Build 24.
**A Solution:** I have achieved the desired effect one way. I built my Unity project (which contains no code reference the second project) and opened the generated Visual Studio solution. There are three projects in VS: Assembly-CSharp, Assembly-CSharp-firstpass, and my actual application. I first build
the entire project. I then add the second project to the solution and add it as a reference to my project. Finally, I copy the code that begins running my second application and I put it in the "App.cs" file in my project (and set it up in a separate thread). This works, but obviously is not ideal. I don't want to do this every time I change something in Unity.
I'd prefer to just have some sort of DLL or something that I can simply drop into the project. I created a UWP Class Library in VS and moved all of the second project's code to this library (along with the NuGet packages, external DLL references, etc.). I then generated a DLL. However:
1. If I drop this DLL into Unity directly then I get `System.Reflection.ReflectionTypeLoadException: The classes in the module cannot be loaded.` This occurs even if I check "don't process" on the inspector.
2. I build the project without the DLL, then go into the generated VS solution and add the DLL as a reference in the project that contains the scripts (this is Assembly-CSharp). I then go and write some code in the `Start()` function of a script to start my application. However, when I build the solution I get the following error: `System.IO.FileNotFoundException: Assembly "myDLLsName, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" file not found.` This error seems like the easiest to fix, but I have not been able to as of yet.
Any help is greatly appreciated!
↧