Could Not Find Type Errors in Visual Studio Designer

Updated Sep 11, 2019

Reported In

Software

  • Measurement Studio

Issue Details


After installing an update to my NI software, I am no longer able to use the Microsoft Visual Studio designer to develop my UI with Measurement Studio components. For example, I cannot see my NI Controls. I can build an exe, but I cannot edit the GUI. When I open a UI that uses Measurement Studio controls, I see several instances of the following error message: 

Could not find type 'NationalInstruments.UI.type'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built using settings for your current platform or Any CPU.



I have referenced NationalInstruments.UI.type in my project, and I can build and run my project without errors. How can I fix the Visual Studio designer?
 

Solution

This issue was introduced in Microsoft Visual Studio 2012 and 2013. The issue happens when the following versions of the NationalInstruments.Common assemblies are different:
  • The version referenced by Measurement Studio assemblies in your project (e.g., NationalInstruments.UI.WindowsForms).

  • The version located in <Measurement Studio>\DotNET\Assemblies\Current and referenced by your project.

  • The latest version located in the global assembly cache (GAC).
For example, this could happen if the version of NationalInstruments.Common referenced by the UI assembly is 13.0.40.242, the version in the Current directory and being referenced by your project is 13.5.40.173, and the latest version located in the GAC is 14.2.40.49152. 

You can resolve this issue by running the attached DesignerFixer.exe utility, or by copying the latest version of NationalInstruments.Common and its dependencies to the program files directory where all the current Measurement Studio assemblies are:

  1. Copy NationalInstruments.Common.dll from C:\Windows\Microsoft.NET\assembly\GAC_MSIL\NationalInstruments.Common\<latest version>\ to <MeasurementStudioInstallDirectory>\DotNET\Assemblies\Current.

  2. Copy NationalInstruments.NiLmClientDLL.dll from C:\Windows\Microsoft.NET\assembly\GAC_MSIL\NationalInstruments.NiLmClientDLL\<latest version>\ to <MeasurementStudioInstallDirectory>\DotNET\Assemblies\Current.

  3. Copy NationalInstruments.MStudioCLM.dll from C:\Windows\Microsoft.NET\assembly\GAC_MSIL\NationalInstruments.MStudioCLM\<latest version>\ to <MeasurementStudioInstallDirectory>\DotNET\Assemblies\Current.

Note: The previous steps contain placeholders. <MeasurementStudioInstallDirectory> is the install directory for Measurement Studio on your computer. For example, this could be C:\Program Files (x86)\National Instruments\MeasurementStudioVS2013<latest version> is the latest version of the assembly which exists in the GAC folder (e.g., v4.0_15.0.40.32769__dc6ad606294fc298).

Force reinstall the software or updating the version could help you to solve this.

Attachments