locked
Unit Testing Broken for Windows Universal Apps in VS 2015 RRS feed

  • Question

  • I've been working on a Windows Store App in C++, first in Windows 8.1 under VS 2013 Professional and then converted over to a Windows 10 Universal App in VS 2015 Professional . I have a unit testing project I use through the Test Explorer that worked fine after the conversion, but has stopped working at some point recently.

    When I launch the test through the Test Explorer, the unit test project builds and deploys without any error messages. Then the app container window comes up for a minute or two and then it goes away. The Test Explorer window just hangs with it's busy bar graphic cycling like it's waiting for a response from the test app. It just hangs, so I have to exit VS to stop it.

    I've tried debugging the test methods with breakpoints, but they apparently never get called even though the test app container launches and then exits.

    I have even created a new solution with a universal unit test project under VS 2015 to see if something might have gone wrong in the conversion. The new solution and test project have the same problem.

    Is unit testing in VS 2015 just broken? Is there a fix or a workaround available? I'd appreciate any help.

    Thanks.

    Edit:

    Now, I'm getting this error on deployment:

    Error : DEP3000 : Attempts to stop the application failed. This may cause the deployment to fail. 
    Exception from HRESULT: 0x92330047

    • Edited by Don J. Jordan Tuesday, February 23, 2016 8:00 PM More info
    Tuesday, February 23, 2016 7:39 PM

Answers

  • Here I am answering my own question, but it's an answer nevertheless. I spent ten weeks working with Microsoft's Visual Studio tech support (letting them remotely access my system to run test programs and produce log files). No one was able to figure-out what was going on. Finally, they put me in touch with the person who implemented and maintains the unit testing framework for VS. We also went through a couple of remote sessions with their developer examining my system. On the latest session he finally figured-out what was failing.

    The test app launched by visual studio uses the local network to send the unit testing results to the IDE app. If there is more than one network adapter on your computer, the unit testing framework can get confused and try communicating with the IDE via the wrong network adapter. Thus, the VS TestExplorer just hangs there waiting for a response from the test app while the test app hangs there trying to find the TestExplorer over the wrong network.

    The workaround: My development system has three network adapters: Ethernet, Bluetooth and Wi-Fi. Disabling both the unused Bluetooth and Wi-Fi adapters forced the unit testing framework to locate the IDE on the correct adapter. After that, the unit testing started to function again. Once it started working, I was able to re-enable the other two adapters. I assume that if it fails again, then I would have to go through the same process.

    Microsoft will eventually include a fix for this problem in a future build of Visual Studio, but until that time, you can remedy the issue and disabling the unused network adapters, run the unit tests so they can locate the TestExplorer, and then re-enable the adapters.

    • Marked as answer by Don J. Jordan Sunday, April 9, 2017 12:02 AM
    Sunday, April 9, 2017 12:01 AM

All replies

  • Hi,

    Thanks for your post.

    >>Error : DEP3000 : Attempts to stop the application failed. This may cause the deployment to fail. 
    Exception from HRESULT: 0x92330047

    I did a research for the error message you offered. And I found some other member encountered the same problem and solved it by explicitly deploying the test project and re-invoking "Run All Tests".

    You can also check under "Add or remove programs" whether your test project app is (deployed) installed or not. If necessary, uninstall it and deploy again.

    In addition, since the error occurred for a new created universal unit test project under your VS2015.

    I suppose there is something wrong with your VS2015. Please try to the following steps to check whether the error occurred.

    1.Start a new Project
    2.From the templates, choose: Templates > Visual C++ > Windows > Universal > Unit Test App (Universal Windows)
    3.Write a simple test: Assert.IsTrue( true )
    4.In the Test Explorer, Test > Run > Run all tests

    If the same error occurred . I think the problem is in your Visual Studio. In this case, I suggest you could repair your VS2015 Under Control Panel then try it again.

    Best Regards,

    Lake Xiao

    • Proposed as answer by lake Xiao Friday, February 26, 2016 6:38 AM
    Wednesday, February 24, 2016 5:38 AM
  • The test project fails to work whether I delete/deploy it manually or have Visual Studio do it.  I mentioned in my OP that the unit testing doesn't work even if I make a new test solution / project as you suggested.

    Now there's a new wrinkle: Visual Studio will no longer load the projects (app and test) in my solution. It just labels the projects as "incompatible."

    I tried having the installer repair Visual Studio. That didn't work. I also uninstalled Visual Studio and re-installed it and that didn't work either.

    At least everything works on my home system, so I can get some work done.

    Apparently, there is some setting somewhere that got corrupted that is not reset by re-installing Visual Studio. I have half a mind to nuke the system drive and re-install Windows 10 and Visual Studio.

    Saturday, February 27, 2016 4:11 AM
  • I deleted the hidden .vs folder in the solution directory. This caused VS to show me some error messages for why the project files are incompatible. It says they target the wrong version of VS and gives me a link to upgrade to VS 2013? HUH? Looking at the XML for the project files, all the version properties target 14.0, which is VS 2015. Even the error messages are bogus.

    Whatever...

    Anyway...are there any hidden folders or files that VS uses that I can delete to make it reset itself?

    Sunday, February 28, 2016 3:41 AM
  • Hi,

    >>Anyway...are there any hidden folders or files that VS uses that I can delete to make it reset itself?

    As far as I know. You can delete the .suo file under .vs folder to then rebuild your solution then try it again.

    >>I mentioned in my OP that the unit testing doesn't work even if I make a new test solution / project as you suggested.

    In addition, since it doesn't work for a new created Unit Test project. I think there might be something error during your installing VS. As it works well in my side with the same version of VS as yours.

    So if possible, please use http://aka.ms/vscollect  to gather the VS and .Net Framework installation logs. After using it, you will find vslogs.cab from %temp% folder. Please upload the file to Onedrive and share the link here.

    I will help you to check the installation log of your Visual Studio.

    Best Regards,

    Lake Xiao


    • Edited by lake Xiao Monday, February 29, 2016 1:15 AM
    Monday, February 29, 2016 1:15 AM
  • I think I found the problem, but I don't know how to fix it. I deleted the activitylog.xml file for VS and I loaded a fresh copy of the solution file from version control. VS says it can't load the C++ projects and here is the offending error in the activity log:

    <entry>
        <record>153</record>
        <time>2016/03/01 04:02:26.537</time>
        <type>Error</type>
        <source>VisualStudio</source>
        <description>No InprocServer32 registered for package [Visual C++ Project System Package]</description>
        <guid>{F1C25864-3097-11D2-A5C5-00C04F7968B4}</guid>
        <hr>8007007e</hr>
        <errorinfo></errorinfo>
        <path>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcpackages\VCProject.dll</path>
      </entry>

    Sure enough, the VCProject.dll file is missing even though the VC folder and it's contents are there. I did a repair and a fresh install of everything--and made sure that C++ was checked. So, how can I get the installer to properly install the C++ packages?????

    Tuesday, March 1, 2016 4:19 AM
  • "So if possible, please use http://aka.ms/vscollect  to gather the VS and .Net Framework installation logs. After using it, you will find vslogs.cab from %temp% folder. Please upload the file to Onedrive and share the link here."

    Here's the link to the file generated by vscollect. The extension says zip, but I think it's really a cab file.

    vslogs.zip

    Tuesday, March 1, 2016 5:04 AM
  • Hi,

    Thanks for your update.

    I have tried to open the log file you updated. But it says that the file is invalid. I can't open it in my side.

    Please collect the installation log then upload it again. And I think the problem of your issue is probably in your VS installation.

    Best Regards,

    Lake Xiao

    Tuesday, March 1, 2016 5:52 AM
  • OK. Try this file. It opens for me:

    vslogs.zip

    Tuesday, March 1, 2016 11:49 AM
  • Hi,

    I have checked the installation log you offered. And there is no error in it. So I think the installation of your VS is correct.

    By the way, please try this:

    1. Open your Developer Command Prompter for VS2015.

    2. input the command "devenv /setup"

    3.  Open your visual studio 2013 then try it again

    Please refer to this MSDN document:

    https://msdn.microsoft.com/en-us/library/ex6a2fad.aspx

    Best Regards,

    Lake Xiao

    • Edited by lake Xiao Wednesday, March 2, 2016 1:32 AM
    Wednesday, March 2, 2016 1:30 AM
  • VS could not possibly have installed correctly because the DLL VS is trying to load to run the C++ environment is missing:

    C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcpackages\VCProject.dll

    Even after a full uninstall and reinstall of VS this file is not being restored. 

    I uninstalled VS one more time. I then went through the system and deleted all the folders installed by VS that are still left behind after an uninstall. Reinstalled again and now the C++ dev DLLs got installed. Everything is running again.

    Thank you for your help. I do appreciate it.


    • Proposed as answer by lake Xiao Wednesday, March 2, 2016 5:12 AM
    • Marked as answer by Don J. Jordan Wednesday, March 2, 2016 3:24 PM
    • Unmarked as answer by Don J. Jordan Wednesday, August 17, 2016 8:52 PM
    • Unproposed as answer by Don J. Jordan Wednesday, August 17, 2016 8:53 PM
    Wednesday, March 2, 2016 5:09 AM
  • Hi,

    Glad to hear you have solved your problem.

    If possible,  lease mark your reply as the answer, so it would be helpful for other members who get the same issue as yours to research and find the answer directly, and I could close this case.

    Have a nice day.

    Best Regards,

    Lake Xiao

    Wednesday, March 2, 2016 5:13 AM
  • Sorry, I missed your answer.

    Yes, everything got running again on my old development system, but the unit test projects still deploy and run the host app, but no test results are displayed in Visual Studio 2015. The only apparent thing I can do next is to try re-installing Windows from scratch and then Visual Studio.  I haven't gotten around to that yet.

    Unfortunately, my new system as of yesterday just started producing this error, so now I have two systems with Visual Studio 2015 that can no longer run the unit test projects. I wish Microsoft would fix this problem. It's very frustrating.

    The only new information I can provide is that this error is posted in the event viewer whenever I try running the unit tests:

    Failed with 0x490 modifying AppModel Runtime status for package 04ce21ff-3b76-4555-afa8-c10448e56f27_1.0.0.0_x64__ts4x3ns1shrp2 for user DONWORKSTATION\Don (current status = 0x0, desired status = 0x20).

    The XML details:

    - <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
    - <System>
      <Provider Name="Microsoft-Windows-AppModel-Runtime" Guid="{F1EF270A-0D32-4352-BA52-DBAB41E1D859}" /> 
      <EventID>69</EventID> 
      <Version>0</Version> 
      <Level>2</Level> 
      <Task>0</Task> 
      <Opcode>0</Opcode> 
      <Keywords>0x2000400000000001</Keywords> 
      <TimeCreated SystemTime="2016-08-17T21:27:01.372690800Z" /> 
      <EventRecordID>863</EventRecordID> 
      <Correlation ActivityID="{BAABE083-F8C2-0006-051A-ACBAC2F8D101}" /> 
      <Execution ProcessID="5172" ThreadID="8664" /> 
      <Channel>Microsoft-Windows-AppModel-Runtime/Admin</Channel> 
      <Computer>DONWORKSTATION</Computer> 
      <Security UserID="S-1-5-18" /> 
      </System>
    - <EventData>
      <Data Name="ErrorCode">1168</Data> 
      <Data Name="PackageFullName">04ce21ff-3b76-4555-afa8-c10448e56f27_1.0.0.0_x64__ts4x3ns1shrp2</Data> 
      <Data Name="User">S-1-5-21-2517689867-3881005725-1709516310-1001</Data> 
      <Data Name="DesiredStatus">32</Data> 
      <Data Name="CurrentStatus">0</Data> 
      </EventData>
      </Event>

    - 
    • Edited by Don J. Jordan Wednesday, August 17, 2016 9:31 PM More information.
    Wednesday, August 17, 2016 9:02 PM
  • Here I am answering my own question, but it's an answer nevertheless. I spent ten weeks working with Microsoft's Visual Studio tech support (letting them remotely access my system to run test programs and produce log files). No one was able to figure-out what was going on. Finally, they put me in touch with the person who implemented and maintains the unit testing framework for VS. We also went through a couple of remote sessions with their developer examining my system. On the latest session he finally figured-out what was failing.

    The test app launched by visual studio uses the local network to send the unit testing results to the IDE app. If there is more than one network adapter on your computer, the unit testing framework can get confused and try communicating with the IDE via the wrong network adapter. Thus, the VS TestExplorer just hangs there waiting for a response from the test app while the test app hangs there trying to find the TestExplorer over the wrong network.

    The workaround: My development system has three network adapters: Ethernet, Bluetooth and Wi-Fi. Disabling both the unused Bluetooth and Wi-Fi adapters forced the unit testing framework to locate the IDE on the correct adapter. After that, the unit testing started to function again. Once it started working, I was able to re-enable the other two adapters. I assume that if it fails again, then I would have to go through the same process.

    Microsoft will eventually include a fix for this problem in a future build of Visual Studio, but until that time, you can remedy the issue and disabling the unused network adapters, run the unit tests so they can locate the TestExplorer, and then re-enable the adapters.

    • Marked as answer by Don J. Jordan Sunday, April 9, 2017 12:02 AM
    Sunday, April 9, 2017 12:01 AM