BadLicenseExpired

Questions regarding the use of the .NET SDK 2.0 for Server or Client development or integration into customer products ...

Moderator: uasdknet

Post Reply
Thomas S.-B.
Full Member
Full Member
Posts: 5
Joined: 20 Apr 2021, 14:02

BadLicenseExpired

Post by Thomas S.-B. »

Hi,
I also posted my Request at UnifiedAutomation Support, but maybe here in this forum anybody has an idea what the problem could be.
Because i am currently stucking and don't know how to proceed.

We developed an opcua server and also an opcua client. Everything works fine until the client suddenly disconnects (after a random timespan) and cannot reconnect anymore..
I also tried it today by connecting with the ua expert, but it was also not possible.. UaExpert returned: BadLicenseExpired.

But i don't know why.. I am using the opc ua sdk and i am also using that license.lic file.

When i debug at startup I can see that the ApplicationLicenseManager has found a valid license with expire date: {1/1/0001 12:00:00 AM}

Does anyone can help me at this issue?

Greetings Thomas

User avatar
Support Team
Hero Member
Hero Member
Posts: 2644
Joined: 18 Mar 2011, 15:09

Re: BadLicenseExpired

Post by Support Team »

Hi,

the evaluation edition can run for 1 hour but can be restarted. However when you disconnect you Client and try connect again after that 59 minutes the connection is refused with the "BadLicenseExpired" error. This one hour is the duration the application is running, not the time the UA session was running (which may be shorter).

If you have integrated the license.lic correctly into your application (as embedded resource) and if you have initiated/loaded correctly as described in the documentation, the license is recognized by the assemblies and the UA connections will overcome the 1 hour limitation.

NOTE: the license.lic file you have received when purchasing the SDK, will only run with the SDK that was delivered to you alongside with the license file. You can not "reuse" the license file in different version of the SDK, and you can not use the license file with the evaluation editon of the SDK. The license file and the SDK must be a matching pair (as delivered to you).

IMPORTANT: if you update the SDK assemblies used in your application, you must "update" (replace) the license file with it.
Best regards
Unified Automation Support Team

Thomas S.-B.
Full Member
Full Member
Posts: 5
Joined: 20 Apr 2021, 14:02

Re: BadLicenseExpired

Post by Thomas S.-B. »

Hi,
thank you for the information..

Hmm.. I already did that as you described...

Code: Select all

                System.Reflection.Assembly assembly;
                assembly = PlatformUtils.GetAssembly(typeof(OpcUaServer.Program));

                // The license file must be loaded from an embedded resource.
                ApplicationLicenseManager.AddProcessLicenses(assembly, "Tat.TurningStation.OpcUaServer.License.License.lic");
                
And when I startup and debug I get following output in console line:
ApplicationLicenseManager.GetAvailableLicense()
{{Product=UaSdkNetBundle-3.0.9-Win32-Binary|Owner=856e0c36-8920-4e31-bb89-d92bd4764b6c|Guid=47da26f7-9788-4cd0-9040-90a8c45ea170}}
AdditionalData: "d747e6b0-2fe7-46ef-b3cf-5f93a75f380b"
ClientSDK: true
ExpiryDate: {01.01.0001 00:00:00}
Features: {UnifiedAutomation.UaBase.ApplicationLicense.Feature[7]}
Guid: "47da26f7-9788-4cd0-9040-90a8c45ea170"
IsTrial: false
OwnerCompanyName: "856e0c36-8920-4e31-bb89-d92bd4764b6c"
OwnerName: "856e0c36-8920-4e31-bb89-d92bd4764b6c"
ProductId: "UaSdkNetBundle-3.0.9-Win32-Binary"
ProductUriClient: null
ProductUriServer: null
ServerSDK: true
I added the license as an embedded resource without copying..

User avatar
Support Team
Hero Member
Hero Member
Posts: 2644
Joined: 18 Mar 2011, 15:09

Re: BadLicenseExpired

Post by Support Team »

Hi Thomas,

Your license printout looks valid. This means that the license was loaded correctly. The other issue now could be that you are using the eval assemblies from our homepage. Also these assemblies cause your application to stop working after one hour. Please check if you are using the assemblies from your personal download directory (where you found the license).
You may need to clear your Nuget cache and reinstall the SDK.
Best regards
Unified Automation Support Team

Post Reply