My TestStand UI Throws a Microsoft Visual C++ Runtime Error After Windows Update

Updated Jan 9, 2019

Reported In

Software

  • TestStand

Operating System

  • Windows

Other

  • .NET Framework 4 Client Profile
  • Windows Vista
  • Windows 7

Issue Details

I recently installed a Windows update for my Windows Vista or Windows 7 computer. After doing so, I installed TestStand on my machine and noticed that I receive the Microsoft Visual C++ Runtime Error shown below when interacting with my custom TestStand User Interface:
Runtime Error!
This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.
 
I also noticed that I receive this same error when interacting with the default user interfaces that ship with TestStand, but the Sequence Editor operates as normal. If I switch to a different version of TestStand that was installed on my machine prior to installing the Windows Updates, I do not see this problem. What is causing this error and how do I resolve it?

Solution

To resolve this behavior perform one of the below options:
  • Install the full version of the .NET Framework 4
    • Download and install the full version of .NET Framework 4 from Microsoft
    • Launch the TestStand Version Selector and select Make Active for the version of TestStand you wish to use.
    • Once that TestStand version has been made active, you should no longer experience this behavior.
  • Manually register the TSDotNetUIControls.dll type library using the .NET Framework 2 RegAsm.exe
    • Open the command prompt (cmd.exe).
    • Note: You must run the command prompt with Administrator privileges.
    • In the command prompt, type:
      • C:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe /tlb "<TestStand>\Bin\TSDotNetUIControls.dll"
        • To determine your <TestStand> directory, type in %TestStand% into a file explorer window
    • Press Enter
    • Once the type library has been registered, you should no longer experience this behavior.
  • Note: The type library only needs to be registered once per machine. After registering the type library for a particular version of TestStand, you will not have to repeat the above steps for that version of TestStand.

Additional Information

Microsoft released an update that installs the Microsoft .NET Framework 4 Client Profile which provides a subset of features from the .NET Framework 4. This update is recommended by Microsoft for Windows Vista and Windows 7 operating systems. For more information on this update, refer to The .NET Framework 4 Client Profile is available on Windows Update.

You may be experiencing this behavior if TestStand is unable to register the type library for the TSDotNetUIControls.dll located in the <TestStand>\Bin directory.
TestStand uses the latest version of RegAsm.exe to register assembly type libraries. The .NET Framework 4 Client Profile update installs a version of the .NET Framework 4 RegAsm.exe which lacks the specific functionality that TestStand requires to successfully register its assemblies’ type libraries. If you have the .NET Framework 4 Client Profile update installed prior to installing a version of TestStand, the TestStand installer will not successfully register TSDotNetUIControls.dll which leads to the error displayed in the Problem section of this article when using a TestStand User Interface. This problem does not affect the TestStand Sequence Editor.