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