Reputation: 1
I have installed Unity 2018.1.0f2. I created a simple project that displays a cube for the HoloLens. Then when I try to build the project in Visual Studio 2017 I get the following errors in the file App.cs.
Error CS0012 The type 'CoreApplicationView' is defined in an assembly that is not referenced. You must add a reference to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime'. PKproject3 C:\Users\Puran Kansakar\Documents\PKproject3\App\PKproject3\App.cs 34 Active
Error CS0012 The type 'CoreWindow' is defined in an assembly that is not referenced. You must add a reference to assembly 'Windows, Version=255.255.255.255, Culture=neutral, PublicKeyToken=null, ContentType=WindowsRuntime'. PKproject3 C:\Users\Puran Kansakar\Documents\PKproject3\App\PKproject3\App.cs 58 Active
How do I solve it?
Puran
Upvotes: 0
Views: 563
Reputation: 658
When you say you are building the project in VS are you first building the project in Unity and then opening the VS Solution file that is created and then building that? You also have to pay close attention to the .NET versions and scripting backend in your build settings as this affects what assemblies are referenced. I would recommend using IL2CPP instead of the .NET scripting backend since the .NET scripting backend is being deprecated. I would also recommend using the highest version of the Scripting runtime version and API compatibility release if you are starting a new project.
Edit: Definitely try the IL2CPP option I described as this gives you the highest .NET surface availalbe.
Upvotes: 0
Reputation: 251
Here, try following this workflow:
If that doesn't work in your Unity version, try a different Unity version. 5.5.x is stable for HoloLens, and I've had luck with the newest ones, such as 2018.2. I have never had luck working with IL2CPP over .NET personally, always led to compiler errors for me.
Upvotes: 0
Reputation: 24
Clean the project and rebuild it and hit start (blue play button). This might solve your problem.
Upvotes: 0