From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Designer mode error.. VS2013

Solved!
Go to solution

Hi,

 

Something has changed in my PC. I can drag and drop NI controls into forms but those are not visible anymore when the form is reopened. Please see the following picture:

 

designermode.png

 

 

I can compile the software and everything works OK in the compiled program.. Just the designer mode has the problem..

 

I have VS2013 and MS3013. The environment has been configured to work together and it has been OK one year or something. Maybe something happened when I tried to update Measurement Sudio.. there were some new option for VS2013 but I never could install that.

 

br,

Ilkka

 

 

0 Kudos
Message 1 of 21
(7,598 Views)
Solution
Accepted by topic author Yltsä

Hi, Ilkka

 

This issue is being caused because the Visual Studio designer is loading NationalInstruments.Common from the program files directory instead of from the GAC. This seems to be happening because the Visual Studio designer is loading assemblies in a way that ignores configuration files.

 

The solution is to copy the latest version of Common and its dependencies to the program files directory where all the current Measurement Studio assemblies are. To fix the issue:

  1. Copy NationalInstruments.Common.dll from C:\Windows\Microsoft.NET\assembly\GAC_MSIL\NationalInstruments.Common\<latest version>\ to C:\Program Files (x86)\National Instruments\MeasurementStudio<version>\DotNET\Assemblies\Current.
  2. Copy NationalInstruments.NiLmClientDLL.dll fromC:\Windows\Microsoft.NET\assembly\GAC_MSIL\NationalInstruments.NiLmClientDLL\<latest version>\ to C:\Program Files (x86)\National Instruments\MeasurementStudio<version>\DotNET\Assemblies\Current.
  3. Copy NationalInstruments.MStudioCLM.dll from C:\Windows\Microsoft.NET\assembly\GAC_MSIL\NationalInstruments.MStudioCLM\<latest version>\ to C:\Program Files (x86)\National Instruments\MeasurementStudio<version>\DotNET\Assemblies\Current.

I use a few placeholders in the steps. <version> is the version of Visual Studio support you have installed (e.g., VS2012). <latest version> is the latest version of the assembly which exists in the GAC folder (e.g., v4.0_15.0.40.32769__dc6ad606294fc298).

 

This issue does not appear to happen in Visual Studio 2010 and earlier. At this point, it seems like a bug in the Visual Studio 2012 and later design view. I will update this page when we uncover more in our investigation.

 

Would you mind posting a picture of the contents of C:\Windows\Microsoft.NET\assembly\GAC_MSIL\NationalInstruments.Common\ here?

 

Warm regards,

Daniel Dorroh
National Instruments
0 Kudos
Message 2 of 21
(7,567 Views)

Hi Daniel,

 

Thanks a lot. Your instructions solved the problem.

 

Here is the content of C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Nationa​lInstruments.Common

 

NI.Common.png

 

Have a nice day,

Ilkka

0 Kudos
Message 3 of 21
(7,537 Views)

Please see the following KB for details on fixing this problem: Could not find type Errors in Visual Studio Designer.

 

Thanks,
Daniel

Daniel Dorroh
National Instruments
0 Kudos
Message 4 of 21
(7,144 Views)

Dear Daniel,

 

I made the previous "manual" fix but after that the WiX installation project was not good anymore because it was using the old assemblies.

 

At the moment it is little complicated.. I switch to the new assemblies when developing in the designer mode and back to the old when making a setup file.

 

Now I am afraid for making the latest "final" fix of your message. Maybe the WiX setup project cannot be recoveread anymore after that..? Or do you have new merge modules or something for the WiX?

 

br,

Ilkka

0 Kudos
Message 5 of 21
(7,129 Views)

Hi, Ilkka,

 

Can you be more specific when you say that the WiX installation project is no longer good? Are you seeing specific errors?

 

I don't know why you would need to switch between the new and old assemblies. The normal behavior of NationalInstruments.Common and its dependencies is to use the latest version via policy file. When new versions of NationalInstruments.Common are installed on the system, the merge modules for that version of Common should also be installed on the system. In other words, you should be distributing the latest version of NationalInstruments.Common anyway.

 

Please explain more about the proble you are experiencing.

 

Thanks!

Daniel Dorroh
National Instruments
0 Kudos
Message 6 of 21
(7,123 Views)

Hi Daniel,

 

We deploy our application into new fresh computers by using an installation program which is based on the WiX sample provided by NI:

 

..DotNET\Examples\Application\Deployment\WiX\All Libraries\All Libraries.2012.sln

 

If I have compiled the project with the new configuration it comes an error in the target PC; missing the latest NationalInstruments.Common.dll.

 

I think that the merge module used in the WiX must be updated..? Or..

 

br,

Ilkka

0 Kudos
Message 7 of 21
(7,119 Views)

Hi, Ilkka

 

Can you provide more information than just the paraphrased error message from the target machine? I think the problem is likely that you have not deployed NationalInstruments.Common, its dependencies, and their policies to the global assembly cache on the target machine. If you are intentionally not installing it to the GAC, it is possible you have not deployed the correct configuration files to the application directory to handle redirection of NationalInstruments.Common assembly binding to the latest version.

 

Please note that we explain the assembly redirect behavior of NationalInstruments.Common in the following help topic: Measurement Studio .NET Class Library Versioning for Development and Deployment. Please take a look at the Common .NET Class Library Versioning for Development and Common .NET Class Library Versioning for Deployment sections.

 

Thanks,

Daniel Dorroh
National Instruments
0 Kudos
Message 8 of 21
(7,074 Views)

 

Hi Daniel,

 

This is the error in the target machine when the designer mode problem is fixed in the development computer:

 

errr.png

 

 

So now I work so that if the designer mode is needed I rename "Current" folder to "Current old" and "Current new" to "Current". And when making the setup file I restore the folder names back.. 😉 LOL..

 

switch.png

 

BR,

Ilkka

 

0 Kudos
Message 9 of 21
(7,066 Views)

The solution is to deploy the correct application configuration file which redirects requests for earlier versions of NationalInstruments.Common to the version you deploy. Can you show us how you have configured Common.wxs? Can you describe the directory into which you are installing your application on the deployment machine? Are all the assemblies next to your application? 

 

Thanks,

Daniel Dorroh
National Instruments
0 Kudos
Message 10 of 21
(7,085 Views)