Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Design Surface License Exception

I have a form designer in my application using the Micrsoft DesignSurface.  When I try to drop one of the NI controls from my toolbox on a form I get an exception "Exeception has been thrown by the target of an invocation".  Debugging the exception reveals that the error is "Unable to load DLL 'nilmClient.dll the specified module could not be found".  I believe this has something to do with the NI license mangager.

 

In the deployment document it states that design time functionality is possible at runtime.  In order to have the design time functionality at runtime you are directed to include  NationalInstruments.UI.Design.dll.  I have included this file in my deployment.  Is there something else that I'm missing?

0 Kudos
Message 1 of 7
(4,912 Views)

Hi justwakingup,

 

Which document are you looking to for the instructions to enable Run-Time Design Functionality?


Milan
0 Kudos
Message 2 of 7
(4,900 Views)

In the Measurement Studio help file under XCOPY deployment.  

 

Step 6: Include Design Time Functionality of Measurement Studio UI Controls at Run Time

If your application requires design time functionality of National Instruments UI controls at run time, you must include the NationalInstruments.UI.Design assembly in your XCOPY deployment. For example, if your application includes the property editor control or a UI control that has a property grid, you must include the NationalInstruments.UI.Design assembly in your XCOPY deployment. The NationalInstruments.UI.Design assembly is located in theInstallDir\DotNET\Assemblies\<NationalInstruments.UI.Design.assemblyversion>\ folder. By default, the InstallDir file path is: Program Files\National Instruments\<MeasurementStudio>.

0 Kudos
Message 3 of 7
(4,895 Views)

Do you have Measurement Studio installed on the target system? Measurement Studio does not support using MStudio controls at run-time in a design-time context. You must have a valid license on the target system in order to use them in a design-time context.

 

I understand this might have been confusing considering the help text you cited. We have already updated that text for the next release of MStudio to state the following:

If your application uses Measurement Studio UI controls run-time property editors, you must include the NationalInstruments.UI.Design assembly in your XCOPY deployment. For example, if your application includes the property editor control or a UI control that has a property grid, you must include the NationalInstruments.UI.Design assembly in your XCOPY deployment. The NationalInstruments.UI.Design assembly is located in the InstallDir\DotNET\Assemblies\<NationalInstruments.UI.Design.assemblyversion>\ folder. By default, the InstallDir file path is: Program Files\National Instruments\<MeasurementStudio>. 

 

Additionally, we have added the following text to the Troubleshooting Licensing Errors topic:

Problem: When I try to run my compiled program, a LicenseException is thrown. 
Solution: Your compiled program uses Measurement Studio controls at run time in a design-time context. To use Measurement Studio controls at run time in a design-time context, you must install Measurement Studio on the target machine and the Measurement Studio license on the target machine must be in a valid license state. The Measurement Studio license type on the target machine must be the same as on the development machine. 

 

National Instruments
0 Kudos
Message 4 of 7
(4,878 Views)

This is unfortunate.  I was under the belief that I could do this based on the text of the help file.  I had developed the software on my machine which has a valid license and didn't get any errors at runtime.  My understanding was that the NI license was baked into my assembly since I have a valid license.  This then allowed me to use the full functionality in my application.  Using the software I developed, it is possible to create screens that can be dynamically loaded at runtime.  When I distributed this to other machines it failed with the licensing issue.

 

Is it legal to execute this code:

 

Scattergraph scatterGraph = new Scattergraph();

 

then attach the graph to a form with a property browser?  Also, is it legal to resize the controls at runtime, add axes and plots.... etc using the property browser?  The property browser works simply on reflection which is a basic function of .NET.  Dropping the NI controls on a form that contains a property browser already puts them in a pseudo design mode.  The design surface is also part of the .NET framework that allows me to drop any control on it that I register in the toolbox service.

 

When we start making XAML applications will be able execute


this.Content = XamlReader.Load(stream);

 

to load a screen from an XML file.

 

 

 

0 Kudos
Message 5 of 7
(4,874 Views)

Using the property browser to modify your controls at run-time is the intended use of the NationalInstruments.UI.Design assembly. It is dropping the controls on the design surface that is the problem. You cannot instantiate the control on a design surface at run-time. This also applies to the XAML scenario that you described.

 


National Instruments
0 Kudos
Message 6 of 7
(4,864 Views)

So if we don't put the control in design mode, which causes the exception, we are good to go with the property grid configuration at runtime.  I can work with that.  Thank you.

0 Kudos
Message 7 of 7
(4,859 Views)