Check if you included Microsoft.NETCore.UniversalWindowsPlatform. For me the UWP project didn't target x64 but Any cpu. Changing it to x64 solved it for me.
Microsoft.NETCore.UniversalWindowsPlatform
x64
Any cpu