Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Slide Range Limits Do Not Transfer from Code to Designer

I am developing a GUI application using Visual Studio .NET and C# that uses a slide control.  If I modify the Range, SlideStyle or ScalePosition in the designer the code generated looks good and compiles and runs correctly,  However, if I close Visual Studio and re-open it and open the designer, the control no longer looks the same.  In the tasks list there are several instances of the message "Object type cannot be converted to target type."  I have tried setting the same values that the control defaults to but I get the same message.  Now, if I make any modifications to the GUI using the designer, I have to set all of the control parameters back to the correct values before I save the code.  Is there a fix or workaround for this?


Jeff S1949
0 Kudos
Message 1 of 3
(3,355 Views)

For each of the following assemblies, go to the References node in Solution Explorer, right-click on the assembly, and click Properties:

  • NationalInstruments.Common.dll
  • NationalInstruments.UI.dll
  • NationalInstruments.UI.WindowsForms.dll

Is the Copy Local setting for any of these assemblies true? If so, that is probably the cause of the problem. The Copy Local setting for each of these assemblies must be false. If it is set to true, the Windows Forms designer will load the assemblies multiple times (once from the local copy and another from the GAC) and will cause type conflicts (such as the "Object type cannot be converted to the target type" message that you're seeing). Note that this issue is a general issue with the Windows Forms designer and has nothing to do with Measurement Studio assemblies. For example, try changing the Copy Local setting for the System.Windows.Forms.dll asembly tro true, close the designer, and re-open the designer.

If that is not the problem, please look at the properties for the references that were listed above and post the value that is shown in the Properties window for the Path and Version properties. Also, please go to the C:\Windows\Assembly folder in Windows Explorer and post the versions of the following assemblies that are in your global assembly cache:

  • NationalInstruments.Design.dll
  • NationalInstruments.Common.dll
  • NationalInstruments.UI.dll
  • NationalInstruments.UI.WindowsForms.dll

- Elton

0 Kudos
Message 2 of 3
(3,346 Views)

Changing "Copy Local" to false fixed everything.

 

 

Jeff S1949

0 Kudos
Message 3 of 3
(3,338 Views)