locked
Unit Tests are failing in TFS Visual Studio Test task but not failed running is Visual Studio RRS feed

  • Question

  • We have a project which consists of about 2000 unit tests. Our OS is Windows 2019, plenty of memory. 

    Our Unit test project builds Successfull using TFS build task(MSBUILD). The project is ".Net"

    Most of the Unit Test fail using Visual Studio Test task. The same Unit Tests are successful when run from VS 2017 on the same build server.

    The common error is shown below:

    Failed   NewMenuFunctionsTest
    Error Message:
    Unable to create instance of class SetupTool.Tester.Services.ModelExtensionsTest. Error: 
    System.ComponentModel.Win32Exception: The operation completed successfully.
    Stack Trace:
    at MS.Win32.UnsafeNativeMethods.RegisterClassEx(WNDCLASSEX_D wc_d)
    at MS.Win32.HwndWrapper..ctor(Int32 classStyle, Int32 style, Int32 exStyle, Int32 x, Int32 y, Int32 
    width, Int32 height, String name, IntPtr parent, HwndWrapperHook[] hooks)
    at MS.Win32.MessageOnlyHwndWrapper..ctor()
    at System.Windows.Threading.Dispatcher..ctor()
    at System.Windows.Threading.Dispatcher.get_CurrentDispatcher()
    at Swf.Common.UnitTestHelper.WpfUnitTest..ctor() in 
    D:\Agent_Downloads\VB32B\_work\1\s\WPF\WPF_Common\Swf.Common.UnitTestHelper\WpfUnitTest.cs:line 97
    at SetupTool.Tester.Services.ModelExtensionsTest..ctor()

    I did some research on error which indicates dispatcher / resource. The Unit tests are for WPF and there are approx 2000 unit tests.  

    What could be the specific problem / Why do Unit Tests work with Visual Studio. Why other information can I provide to diagnose root problem

    Wednesday, January 15, 2020 10:05 PM

All replies

  • Listed is the vstest.console.exe command from VS 2017 command prompt. So many errors are generated.

    vstest.console.exe D:\Agent_Downloads\VB32B\_work\1\s\WPF\WPF_Apps\Swf.SetupTool\UnitTest\bin\Debug\swf.setuptool.unittest.dll /InIsolation /Platform:x64

    Wednesday, January 15, 2020 10:24 PM
  • Hi JosephCortese,

    Welcome to MSDN forum.

    As your issue, we are sorry that this forum is discussing about unit test in VS IDE, and this issue is more related to TFS(azure dev ops). Since tfs forum is locked, we recommend you could redirect to stack overflow with azure-devops tag, where you could get dedicated support for it.

    Thank you for understanding.

    Best Regards,

    Dylan


    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

    Thursday, January 16, 2020 2:55 AM
  • Dylan,

    To be clear is there a specific forum which I can post a problem related to "vstest.console.exe"(Command Prompt for VS 2017) not working properly on Windows 2019?

    The same Unit test DLL works on Windows 10 and Windows 2016 but not on Windows 2019.

    Thanks

    Joe


    Thursday, January 16, 2020 9:18 PM
  • Hi Joe,

    Sorry for my mistake.

    The issue about vstest.console.exe is in the range of our support. 

    I have tried to run vstest.console.exe in Windows 2019 server, and it could work on my side.

    Not sure what causes your issue, may you could try these methods:

    • Copy all output files from original system to Windows 2019, Then in command prompt, open the folder where the tool could write files 
    • Repair Visual Studio

    If it persists, could you please share the error on your side? Looking forward to your feedback.

    Best Regards,

    Dylan


    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

    Friday, January 17, 2020 9:55 AM