Closed AndreaA86 closed 6 years ago
Hello @AndreaA86 ,
You don't have to call the method ValidateLicense
at all. It's more a validation method on your side to make sure you added the license correctly. It's not needed to make the library work.
By default, the first time our library is used, it will register the license.
It will not be a problem if you call it multiple times but you should only do it once such as in the Global.asax
if you have a web application.
Let me know if that answer correctly to your question.
Best Regards,
Jonathan
I tried to add the license in my app.config file (the trial was already expired). I'm using the library in a WinForm application.
When I run the application and I invoked BulkMerge(), an error was generated due to the expired trial. In theory, as you said, the PRO license should be activated after the first use. Therefore I invoked the ValidateLicense() method and after that the error no longer occurred.
Do you think you could provide us with an example of the issue?
The ValidateLicense
is optional but from I understand, on your case, it's required for an unknown reason.
I report all the steps done:
Maybe depends by the trial expired?
Hello @AndreaA86 ,
Here is a project that use an expired version. When adding the license, it works as expected without using the ValidateLicense.
We used your license to make the test.
To try it you will need to:
Yes I have seen that project works. In my case I have an application composed by several c# project. Could it depend on the fact that I have more projects that make up the application? and where I set the library keys?
I have a "Main" project (output type: win application) where I don't have the zBulkOperations reference. Then I have a "Core" project (loutput type: class library) where I have the zBulkOperations reference because I use it here. At the beginning I set the key license in the app.config file (at the bottom) of the Core project and the license it doesn't work when I used BulkMerge. At the end I resolved adding the key license into the Main project and into the Main() I used a static class of the Core project where I call ValidateLicense().
Ok. I verified just now editing your solution adding a new "class library" project called "Core" (to simulate my application). I moved bulklibrary reference and your code into the new "Core" project and I removed the bulk reference from the Request_Expired project. I only use it into the Core project.
Now if I add keys into the app.config of the Core project (that use zBUlk now) the pro license is not activated. Instead If I leave keys into the original app.config of the Request_Expired project, also if I use zBulk in the Core project, the license is activated without call ValidateLicense() method. I must leave license key into the main project app.config file.
However I called ValidateLicense() at the start to check if the commercial license is expired to log this info.
Thanks.
Hello @AndreaA86 ,
If I understand well, that's an expected behavior.
By default, config from a referenced project is not copied to the output directory. So it's expected the license is adding to the main project config file.
Hi. To add the license I added the license name and the key into the app.config in the appSettings section. After that, to enable the pro license I must call the ValidateLicense() method when the application runs before to use the library. It's right? It's a problem if I call this method each time the application runs?
Thanks. Andrea