Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

Programmatically deploy license file

More
22 Nov 2019 12:33 #7997 by trimurarisingh
Hi,
when call first LicensingManagement.Instance.RegisterManagedResource , it's show duplicate key enter error message that why i have check serial first.

Please Log in or Create an account to join the conversation.

More
22 Nov 2019 10:19 #7996 by support
Hello.

First thing to do is to fix the code. You cannot first test what license you have, and then try to register it.

You need to call the LicensingManagement.Instance.RegisterManagedResource *first* . If you like, you can *then* check which license is active - but not before.

Best regards

Please Log in or Create an account to join the conversation.

More
22 Nov 2019 09:28 - 22 Nov 2019 10:16 #7994 by trimurarisingh
I recently bought a "single developer + free runtime" QuickOPC license, Application is getting fails after two hours with "Run time is over the limit in license "Multipurpose".

After deployment on IIS , by default it running well ( trial period mode) and communication with PLC but when ever apply the license copy it giving error message.

I have tried in both way:
1.installed the License by License manger UI ,application is not reading this license , after running same time it's stop the communication with PLC data.
2.Embed the License with Application dll then below error message is coming.

1. Exception Type
TypeInitializationException

Message
The type initializer for 'OpcLabs.EasyOpc.UA.Toolkit.ClientServer.UAClientEngineBase' threw an exception.


2. Exception Type
ArgumentException

Message
Attempt to add existing key into a dictionary.


Code snippet:
public static void RegisterManagedResource()
        {
            try
            {
                // Register a license that is we embed as a managed resource in this program.
 
                // The first two arguments should always be "QuickOPC" and "Multipurpose".
                // The third argument determines the assembly where the license resides.
                // The fourth argument is the namespace-qualified name of the managed resource.
                if (SerialNumber() == false)
                {
                    LicensingManagement.Instance.RegisterManagedResource("QuickOPC", "Multipurpose",
                        Assembly.GetExecutingAssembly(),
                        "PSGCalibration.Licen.Key-Permanent-WebForm-1999224827-20191120.bin");
 
                    // Instantiate the client object, obtain the serial number from the license info, and display the serial number.
                    var client = new EasyUAClient();
                    long serialNumber = (uint)client.LicenseInfo["Multipurpose.SerialNumber"];
                    Console.WriteLine("SerialNumber: {0}", serialNumber);
                }
            }
            catch(Exception ex)
            {               
                Logger.Log(ex);
            }
 
 
        }
        public static Boolean SerialNumber()
        {
            Boolean flag = false;
 
            try
            {
                // Instantiate the client object.
                var client = new EasyUAClient();
 
                // Obtain the serial number from the license info.
                long serialNumber = (uint)client.LicenseInfo["Multipurpose.SerialNumber"];
 
                // Display the serial number.
                Console.WriteLine("SerialNumber: {0}", serialNumber);
 
                // Determine whether we are running as demo or trial.
                if ((1111110000 <= serialNumber) && (serialNumber <= 1111119999))
                {
                    flag = false;
                    Console.WriteLine("This is a stock demo or trial license.");
                }
                else
                {
                    Console.WriteLine("This is not a stock demo or trial license.");
                    flag = true;
                }
 
            }
            catch(Exception ex)
            {
                flag = false;
                Logger.Log(ex);
            }
            return flag;
        }
Please resolve this issue.

Thanks,
TM
Last edit: 22 Nov 2019 10:16 by support.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.051 seconds