locked
WinRT: Failed to activate Windows Store app unit test executor RRS feed

  • Question

  • I created a "Class Library (Windows Store apps)" project, and it seems to work in VS2013.

    I need to create Unit Tests for my class library, so I created a "Unit Test Library (Windows Store apps)" project. That compiles just fine.

    Then I tried Tests -> Run -> All Tests. I added "Debug.Assert(true); to the default TestMethod1() thinking that would work. And yes, that works.

    In the Unit Tests project, I add a reference to the class library, then run the default test again. This time, I get the following error:

    Failed to activate Windows Store app unit test executor. Error: This app does not support the contract specified or is not installed.

    Any idea why the simple act of adding a reference to a class library causes this error? I didn't change the code at all.

    Thanks...


    Randy



    Saturday, November 30, 2013 7:53 PM

Answers

  • I'll complete my own question.

    The other mistake I made was to let the UnitTests project compile to the same directory as all the projects in my solution. When I changed the UnitTests project back to compile to the default location, all the other problems seem to have gone away.

    Thanks for letting me sound this out. If anyone benefits from these, feel free to mark them as helpful.


    Randy

    • Marked as answer by Anne Jing Wednesday, December 4, 2013 7:38 AM
    Monday, December 2, 2013 7:52 PM

All replies

  • I kept hacking at this and found that if I actually filled in a unit test method and tried to run it, I got the following error:

    Could not find the file c:\blah\MyProject\bin\x86\Debug\resources.pri

    I do have a Resources.resw file in my project under test. I started digging and found a resources.pri under the c:\blah\MyProject\bin\x86\Debug\Appx directory. I manually copied the resources.pri up one level to the Debug directory. That allowed me to run the unit test successfully.

    I there a way to configure the project so that the unit tests find the resources.pri file in the default Appx directly? Do I have to resort to a post-build step to copy the resources.pri to the Debug directory?


    Randy

    Saturday, November 30, 2013 8:45 PM
  • Hi, Randy

    You can package a complex component as a Visual Studio extension SDK, to make it easy to install and use. Users only need to set one reference for the entire package.

    Please see these links below to know how to distributing a managed Windows Runtime component:

    http://msdn.microsoft.com/en-us/library/windows/apps/jj614475.aspx

    http://timheuer.com/blog/archive/2012/03/07/creating-custom-controls-for-metro-style-apps.aspx

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, December 2, 2013 2:44 AM
  • The reply really is appreciated.

    Perhaps I can ask a different way:

    My Comm project includes Resources.resw, and this resource compiles to a resources.pri file in the c:\project\bin\x86\Debug\Appx\ directory. This compiles and everything works just fine.

    I just added a Comm.UnitTest project. The Comm.UnitTest project is failing to compile with the following error:

    File c:\project\bin\x86\Debug\resources.pri not found.

    And of course it's not found. When the Comm project creates the resources (which isn't on every compile), it ends up in c:\project\bin\x86\Debug\Appx\resources.pri.

    The easiest thing would be to get the UnitTests project to stop looking for this file, so if someone knows how to do that...

    The alternative is to make the resources.pri visible to the Unit Test project.

    Thanks...


    Randy

    Monday, December 2, 2013 7:19 PM
  • Somehow, the references for my UnitTests project included a reference to my Views project. Once I removed that, I stopped getting the error about resources.pri.

    However I'm back to the error below. This makes me wonder if the UnitTests project cannot find the deployed app. Any ideas on how to verify if a UnitTest is finding the deployed app?

    If it matters, I'm using Windows 8.1 and VS2013.

    Copying files: Total 2 mb to layout...
    
    Checking whether required frameworks are installed...
    
    Registering the application to run from layout...
    
    Deployment complete. Full package name: "4f717104-580a-41ee-9b15-60d2d4358514_1.0.0.0_x86__f27d9mnk88gne"
    
    Failed to activate Windows Store app unit test executor. Error: This app does not support the contract specified or is not installed.
    ========== Run test finished: 0 run (0:00:05.5998984) ==========


    Randy

    Monday, December 2, 2013 7:41 PM
  • I'll complete my own question.

    The other mistake I made was to let the UnitTests project compile to the same directory as all the projects in my solution. When I changed the UnitTests project back to compile to the default location, all the other problems seem to have gone away.

    Thanks for letting me sound this out. If anyone benefits from these, feel free to mark them as helpful.


    Randy

    • Marked as answer by Anne Jing Wednesday, December 4, 2013 7:38 AM
    Monday, December 2, 2013 7:52 PM