Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

license exception using Datasocket under VisualStudio 2008

I'm try to run an application which uses the DataSocket class. Compiling went fine. When the application constructs an object of class DataSocket I get an exception:
 
          NationalInstruments.Net.DataSocket is unlicensed.
 
The source code is as follows:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NationalInstruments.Net;

namespace

Datasocket
{
  public partial class Form1 : Form
 
{
   
public Form1()
    {
     
InitializeComponent();
     
DataSocket socket = new DataSocket();  // exception occurs here!
     
int[] array = new int[10];
     
array.Initialize();
      array[0] = 100;
     
socket.Data.Attributes.Add("Data", array);
      socket.Connect(
"dstp://localhost/soi", AccessMode.ReadWriteBufferedAutoUpdate);
      socket.Data.Value = array;
    }
  }
}

<End of source code>

I'm using Visual Studio 2008. The version of NationalInstruments.Net.dll is 8.0.11.236.

I'm aware of the fact that my version of Measurement Studio does not match Visual Studio 2008 but I read many posts where Visual Studio 2005 and Measurement Studio do cooperate, only those are all compiling issues. I have a runtime issue.

Does anyone have suggestions? Thanks in advance.

Peter Caron
Eye-Concept Industrial Automation BV
The Netherlands

 

0 Kudos
Message 1 of 5
(5,053 Views)

In addition to my previous post:

I also tried the same source code under Visual Studio 2005 and the same exception is raised.

Peter Caron
Eye-Concept Industrial Automation BV
The Netherlands

0 Kudos
Message 2 of 5
(5,051 Views)
Hi Peter,
 
Allow me first to address the licensing error with Visual Studio 2008. Currently Measurement Studio doesn't support Visual Studio 2008 and only supports Visual Studio 2005 and Visual Studio .NET 2003. However, you can use existing Measurement Studio assemblies in Visual Studio 2008 which is described in the Using Measurement Studio 8.1.2 and Prior in Visual Studio 2008 tutorial. Now, because we don't have support in Visual Studio 2008 yet, this means that there is no integration into Visual Studio 2008 and therefore you need to manually add the license strings to the .licx file for licensing to work properly. This is discussed in the Using Measurement studio 8.12 with Visual Studio 2008 KB.
 
The above statements were my first thoughts when you mentioned getting license errors in Visual Studio 2008. The behavior you mentioned makes sense in Visual Studio 2008. However, you then mentioned that you were getting this same error in Visual Studio 2005.  Based on that, I have a few questions for you:
 
1) Do you have any .lic files in the <MeasurementStudioVS2005>DotNET\Assemblies folder?  You should have licenses like WindowsForms.lic, WebForms.lic, etc.  If you don't have those, it makes sense that your getting license messages.  Then the question is why don't you have those license files.
2) Do you get unlicensed errors if you create a new Measurement Studio project using the NI we project wizards?
3) Do the DataSocket .NET shipping examples work?
4) What happens if you remove and then re-add the Measurement Studio references from the References folder in the Solution Explorer?
5) Have you tried refreshing the license file via option under the Measurement Studio menu?
6) Open the licenses dialog by choosing the Licenses item found under the Measurement Studio menu. Does the dialog indicate that your assemblies are unlicensed?

Best Regards,

Jonathan N.
National Instruments
0 Kudos
Message 3 of 5
(5,019 Views)

Hi Jonathan,

Thank you for your directions. I managed to create a .licx file and the problems are over. Thanks again.

Peter Caron
Eye-Concept Industrial Automation BV
The Netherlands.

0 Kudos
Message 4 of 5
(5,013 Views)

I am getting the same error.

My app has been running for a very long time and just stopped. As I tried to debug it I found it to be a licensing error.

NationalInstruments.Net.DataSocket is unlicensed.

I went back to the solution and I do have the .LIC files in the assemblies directory and I have a Licenses.licx file in the project directory with the NI licenses in them with the correct versions listed.

I removed the references in my project (VS2003) and readded them with no errors and they now list the corect version (had old version listed before I removed & replaced them).

Where does the .licx file need to be place in the app directory with the executable? Can I apply the license string manually to them?

Thanks

 

0 Kudos
Message 5 of 5
(4,777 Views)