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

  • Question

  • .Net Framework Support groups,

    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

    • Moved by Alex-KSGZ Thursday, January 16, 2020 1:26 AM
    Wednesday, January 15, 2020 8:16 PM

All replies

  • Maybe, a UT forum would be a more appropriate forum to post about the issues.


    Also, there is Stackoverflow.



    Wednesday, January 15, 2020 9:01 PM
  • DA924x,

    I am taking your advice and opened the question on UT forum. 



    Wednesday, January 15, 2020 10:07 PM