locked
Getting an unable to add a reference to my UWP project RRS feed

  • Question

  • I'm working on a UWP project. I've added some classes and want to do some unit testing against those classes. Therefore, I added a unit test project to the solution. Then from within the unit test project I tried adding a reference to the UWP project.

    No go.

    Instead I got an error message that says simply, "Unable to add a reference to project 'MyUWPProject'".

    That's it. No error number, nothing. That's all I've got to go on.

    Any ideas as to how I can resolve this?

    I'm working with VS 2015.


    Rod

    Saturday, May 13, 2017 2:16 PM

Answers

  • Hi Rod, 

    Which test project you've added? 

    To test UWP app need use Unit test App (Universal windows) project

    if you add the Unit Test project under common test template: 

    Then you will get error when you add reference

    Hope it helps. 

    Please feel free to let me know if I misunderstood. 

    Best regards, 

    Fletch


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Fletch Zhou Monday, May 15, 2017 5:21 AM
    • Proposed as answer by Fletch Zhou Tuesday, May 16, 2017 1:37 AM
    • Marked as answer by Doctor-Who Wednesday, May 24, 2017 2:28 AM
    Monday, May 15, 2017 5:20 AM

All replies

  • Hi Rod, 

    Which test project you've added? 

    To test UWP app need use Unit test App (Universal windows) project

    if you add the Unit Test project under common test template: 

    Then you will get error when you add reference

    Hope it helps. 

    Please feel free to let me know if I misunderstood. 

    Best regards, 

    Fletch


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Fletch Zhou Monday, May 15, 2017 5:21 AM
    • Proposed as answer by Fletch Zhou Tuesday, May 16, 2017 1:37 AM
    • Marked as answer by Doctor-Who Wednesday, May 24, 2017 2:28 AM
    Monday, May 15, 2017 5:20 AM
  • Thank you Fletch, that is exactly what I was doing wrong. I didn't even know there was a separate unit test project for Universal Windows apps! Thank you very much!!

    Rod

    Wednesday, May 24, 2017 2:29 AM