Failed to create holographic space for window - can't play Windows Holographic device in-editor

I am building my app for hololens. I have recently changed my system. So I had to move my project to the new system. I am using unity 2017.2.0f3 and .net framework 3.5

I am using Universal Windows platform and sdk version 10.0.16299.0.

When I am trying to play in the unity editor the app seems to work fine but it throws this error.

Assertion failed: Failed to create holographic space for window - can't play Windows Holographic device in-editor! Error code: '0x80070005

Any one could help please?

Changed Build settings>Target Device>Any Device from Hololens.
The error is gone.