There are several solutions to your problem. The first one (probably the most naive), is to create two different projects, each of which has a different reference. Then you can write a third layer that uses data provided from the first two projects.
If you really need to use both the references in the same project, there is however another option, and it consists in using extern aliases.
First of all, add a single reference (for instance, Microsoft.Kinect, version 1.8). Then, save your project and close Visual Studio. In the project folder, you should find a .csproj file, that you can open with a text editor. Looking at its content, you will find a line like this:
<Reference Include="Microsoft.Kinect, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
Now, change the above line with the following ones:
<Reference Include="Microsoft.Kinect, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Aliases>KinectV1</Aliases>
</Reference>
<Reference Include="Microsoft.Kinect, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<Aliases>KinectV2</Aliases>
</Reference>
You should see now both references in the same project, also when you open it with Visual Studio.
Then you should be able to use something like this:
// You must declare aliases here:
extern alias KinectV1;
extern alias KinectV2;
// Then some using...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
// ... and do not forget Kinect!
using KinectV1;
using KinectV2;
// Now you can do something like this:
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
// Something from Microsft.Kinect V2
KinectV2.Microsoft.Kinect.HandState hs = KinectV2.Microsoft.Kinect.HandState.Closed;
// Something from Microsft.Kinect V1
KinectV1.Microsoft.Kinect.Skeleton s = new KinectV1.Microsoft.Kinect.Skeleton();
}
}
}
If your project does not compile, try to close Visual Studio and delete the hidden .suo file (in the same folder of the .sln file of your project).
Take a look to this answer if you have any more troubles.