Search code examples
winapivisual-studio-2015windows-runtimewindows-store-apps

Visual C++ 2015 add a reference (WinRT) to only one platform?


I need to add a Reference to a API in our multiplaform project for WinRT. If I add the reference it conflicts with the other plaforms - Win32 for example. Is it possible to add a reference and make it invisible to other platforms somehow?


Solution

  • To solve this problem one needs to manually edit the project and add the necessary conditions to their project files by hand.

    For example:

    <ItemGroup Condition="'$(Platform)'=='Win32'">
      <SDKReference Include="Chat API, Version=8.0" />
    </ItemGroup>
    

    I've been told by MS that they do not intend to add GUI support for SDKReferences.