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.

License works in Debug, but not when bundeled in an installer

More
07 Jun 2022 18:59 #10940 by janko.mihelic@adnet.hr

support wrote: 1. So, can you do this test while you have the license uninstall from the License Manager - and what are the results then?


Yes, I understand this, this was happening before I even downloaded License Manager. After I installed it, I've deleted the registry entries it created to get the wanted state.

support wrote: 2. You wrote "I put in code to log the embedded resource, and it gives me the same license I have in my code. ". I do not not understand what that means. Please describe it better.

I tried to describe what this part of code does:
using ( System.IO.Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream( "Adnet.Fep.Protocol.OPC_UA.Key-Permanent-ShareIt-1999352962-20220523.txt" ) )
using ( System.IO.StreamReader reader = new System.IO.StreamReader( stream ) )
{
  System.IO.File.WriteAllText( @"c:\temp\logLicense.txt", reader.ReadToEnd() );
}
In code I wrote the contents of the embedded resource to a .txt file. That way I saw that the correct embeded resource was in there at runtime.

support wrote: 3. The " [...]" at the end of error message brief indicate that there are more lines present, but not displayed. And, they may contain useful information. Please obtain the error again, but extract the full Message from it.

I'll try to do that.

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

More
07 Jun 2022 15:05 #10937 by support
Hello,
I need some clarifications.

1. You wrote "...when I check the license in Debug mode, it gives me the same serial number I get in the License Manager. ". In this case, do you have the license installed in the License Manager at the same time as when running the test with the embedded license? Because, if you do, even if the embedded license is not found, the one from registry (License Manager) will be found. So, can you do this test while you have the license uninstall from the License Manager - and what are the results then?

2. You wrote "I put in code to log the embedded resource, and it gives me the same license I have in my code. ". I do not not understand what that means. Please describe it better.

3. The " [...]" at the end of error message brief indicate that there are more lines present, but not displayed. And, they may contain useful information. Please obtain the error again, but extract the full Message from it.

Thank you

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

More
07 Jun 2022 14:53 #10936 by janko.mihelic@adnet.hr
I embedded the license in my code, and when I check the license in Debug mode, it gives me the same serial number I get in the License Manager. Above the 1111110000-1111119999 range, and everything works.

But we package our code in an Microsoft Visual Studio Installer Project. When I install our product with the installer, my program gets a serial number between the 1111110000-1111119999 range. I put in code to log the embedded resource, and it gives me the same license I have in my code. I tried to get the exact resource name with ildasm.exe, but the resource name is the same (I copy pasted it). After 30 minutes it gives me this:
07.06.2022 16:19:43.162    *** Failure: Run time is over the limit in license "Multipurpose", serial number 1111111120. The license you are running (most likely trial version) does not provide valid data after certain time period expires. Note that after the component's process is simply restarted, valid data will be provided again. Obtain and install proper license to permanently resolve this error. You can ask for evaluation license key, if you need a longer run time for your tests. [...]

My code that checks the license goes like this:
try{
using ( System.IO.Stream stream = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream( "Adnet.Fep.Protocol.OPC_UA.Key-Permanent-ShareIt-1999352962-20220523.txt" ) )
using ( System.IO.StreamReader reader = new System.IO.StreamReader( stream ) )
{
  System.IO.File.WriteAllText( @"c:\temp\logLicense.txt", reader.ReadToEnd() );
}
 
LicensingManagement.Instance.RegisterManagedResourceWithExistenceCheck( "QuickOPC", "Multipurpose",
  System.Reflection.Assembly.GetExecutingAssembly(),
  "Adnet.Fep.Protocol.OPC_UA.Key-Permanent-ShareIt-1999352962-20220523.txt" );
}
catch (Exception ex )
{
  FepServer.LogError(ex );
}

The catch never triggers, so it seems that it managed to find the resource. I don't know what to try next.

Thanks for your help

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

Moderators: support
Time to create page: 0.051 seconds