c++windows-10-universalvs-community-edition

VS Community Error when trying to add references


I am attempting to add references to C++ Universal Windows Application in VS Community 2015. When I attempt to do so, I get the following error:

Index (zero based) must be greater than or equal to zero and less than the size of the argument list.

enter image description here

What is causing this? I have done this before and it has worked fine. Even in this project it has worked before, but I had to remove the project and add it again, and now I cannot add the reference. How can I fix this?

Thank you


Solution

  • Yup minutes after posting this question I found an answer. The problem: the referenced project was targeting a higher version of Windows than the main project.

    To change target version:

    Right-click on the project and click Properties. Then change the Target Platform Version so that the referenced project has one lower or equal to the main class.