Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How to manage NI Analysis 7.0 licence file on .NET 2003

The exact question is:

How to manage the licence file when you have an application A who call an assembly B who call the NI Analysis measurement studio assembly?

 

I build my own assembly use for calculations and this assembly calls some methods of the NI Analysis assembly.

In my own assembly (C#), all is working fine (the licx file is correctly used).

As soon as I try to use my own assembly in another assembly or application, I’ve got this following message:

 « The Measurement Studio assemblies used in this application are unlicenced (...) »

 

At this level I expect that the licence must be only managed by the assembly who is using NI Analysis methods.

 

Software configuration:

- Measurement Studio 7.0

 National Instruments Analysis Enterprise, runtime version v1.1.4322, version 7.0.0.341

 

- .NET 2003

 Framework 1.1, version 1.1.4322 SP1

 

Moreover, when this time I try to include the licence managing in the application by adding calling a NI Analysis method to workover this problem, I’ve got another problem:

If I call first a local method to the application who invokes a NI Analysis method before my own method in another assembly, all is working fine.

As soon as I first call my own method in another assembly and after a local method to the application who invoke a NI Analysis method, I’ve got the same error message.

 

Please someone can tell me how to manage NI software licence in this case?

 

Please find enclose a small C# project

 

Thank's for help

0 Kudos
Message 1 of 10
(5,960 Views)
Hi XavierS,

The only problem I found in your two assembly projects were that you had a incorrect Pre-Build step. The lc.exe /target...... that you were using is specificcally for licensing Measurement Studio .NET class libraries in managed or unamanged C++ applications. You are using C# and thus you do not need that statement in there.

As soon as I removed those statements from both your projects, rebuilt the assembly and the application, everything worked fine.

Delete those statements and then post back if you have problems.

Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 2 of 10
(5,955 Views)
Thank you for your quick answer.
 
As you explain, I remove the pre-build options for the 2 project in the sample I gave (I will see this point later in another thread but for an other project, this was the only way to make desapear the error message).
 
In the sample I gave this was the only way I found to avoid to have the error message.
Now you can slightly change the application code as below to :
 
- remove the call of the local method who invoke a NI analysis method:

private void checkBox1_CheckedChanged(object sender, System.EventArgs e)

{

ClassLibrary1.Class1 toto =

new ClassLibrary1.Class1();

}

- or to invert the 2 calls:

private void checkBox1_CheckedChanged(object sender, System.EventArgs e)

{

ClassLibrary1.Class1 toto =

new ClassLibrary1.Class1();

FakeFunction1();

}

Theses 2 ways of changing the code have the same effect on my computer, when I activate the checkbox, I obtain the error message.

Is it the same for you?

0 Kudos
Message 3 of 10
(5,951 Views)

Hi XavierS,

I took your exact code that you provided me, deleted those pre-build steps, re-built the assembly and the project and I did not receive any errors. I was able to run your Windows application and click the checkbox without issues.

When you posted back, I once again tested out your application (both the original application and the suggestions you made in the post of moving FakeFunction1() and didn't have any problems at all.

In your main windows application, try refreshing the project license file under Measurement Studio >> Refresh Project License File. Also, does the menu, Measurement Studio >> Licenses show everything as Valid License?

If all of these are fine, try sending me another version of your project with the updates you have made and I can try and run it again.

Thanks

Jonathan N.
National Instruments
0 Kudos
Message 4 of 10
(5,936 Views)

Hi Jonathan,

The problem can be related to the installation of the software.
I my particular case and for another collegue the "Measurement Studio " menu does not appear.
Please note that I recently uninstall and re-install the whole NI softwares on my computer.
 
Moreover the "Refresh Project License File" does not appear for Measurement Studio 7.0 but as I remember appear in version 8.0.
version 8.x is under test in our department but we whish to solve this problem before migrating all of our project to a version 8.x
 
When I check the licence under NI licence Manager, all seem to be correct.
 
Is it possible to manualy refresh the licence file?
 
Xavier.
0 Kudos
Message 5 of 10
(5,932 Views)
Hi Xavier,

Yeah, I was actually testing your code with a later version of the Measurement Studio and there were some features we added. However, I actually went to my test machine and installed Measurement Studio 7.0 and ran your code fine.

Are you getting a unlicensed dialog box that states the application will close in 30 seconds?

Now based upon the fact that you mentioned you didn't have a Measurement Studio menu, I am assuming that you didn't install Visual Studio .NET 2003 integration. In that case, you need to manually license the assemblies. Refer to the "Licensing Measurement Studio .NET Controls without Integrated Tools" help topic that tells you how to do this.

Try that and then let me know what happens!

Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 6 of 10
(5,926 Views)
Thank you very much,

The dialogBox is "Unlicenced Assemblies" and the end error message is:
"(...) This program will automaticaly shut down in 30 second.(...)"

I will try the manually licencing.

Xavier.
0 Kudos
Message 7 of 10
(5,921 Views)

I've just read the "Licensing Measurement Studio .NET Controls without Integrated Tools" help topic.

In fact (and unfortunately) I have already complete manualy the .licx file to add the Analysis line. Because I found that when I add a NI graphic control, the .licx is automaticaly created/updated but not for Analysis components. (At the beginning, before doing this, each calling of Methods of the analysis assembly make the error message box appear)

Are the .licx files at the good place in the project?

Does we need a .licx in the application project as soon as only the assembly called by this application is directly using the Analysis components? 

Xavier.

0 Kudos
Message 8 of 10
(5,920 Views)
Hi Xavier,

When you built your assembly, did you make sure that the Build Action property on the licenses.licx file was set to Embedded Resource? Maybe that is not set for you? That ensures that the license gets built into the assembly so it can be used without license errors in other applications.

The license files are in a normal location. Again, I was able to run your exact project (only deleting those build steps) normally and without any errors.

Now, if you top-level application isn't making direct calls to the NI assemblies, then you of course won't need the licenses.licx file. However, anytime you are referencing NI assemblies in your project, you will need a licenses.licx file.

Make sense?
Jonathan N.
National Instruments
Message 9 of 10
(5,917 Views)

All is working fine now !

I set all the parameters as you describe, the Build Action property on the licenses.licx file was set to Embedded Resource but a manual cleanning of all the project and a rebuild of all the elements was necessary to make it work.

I will try noy to apply all of this on a more slightly complex project.

Thank you for the help.

0 Kudos
Message 10 of 10
(5,912 Views)