How to add WINMD reference to ControlChannelTrigger

1.6k views Asked by At

After upgrading the project to target Windows 10, Visual Studio 2015 fails to resolve the mentioned class. According to the documentation on MSDN, I believe that I need to add a WINMD, namely Windows.Networking.Sockets.ControlChannelTriggerContract.winmd, as reference to my project which I do not see in the project references. I tried looking for it and found the *.winmd file in Windows Kits\10\... folder. Unfortunately, this is what Visual Studio gave when I attempt to add it:

Fail adding reference

Apparently, I know no way to resolve this. (I should have .NET Framework 4.6.) Can somebody help?

1

There are 1 answers

1
Rob Caplan - MSFT On BEST ANSWER

Don't add the winmd directly. For ControlChannelTrigger add a reference (right click on the Project's References and choose Add Reference...) to either the "Windows Desktop Extensions for the UWP" or the "Windows Mobile Extensions for the UWP" (or both if you target both Desktop and Mobile). These are both in the Universal Windows/Extensions section of the Reference Manager window:

Add Reference from Solution Explorer

enter image description here