Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Version 3 error?

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Licensing Support
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Mon Jul 17, 2006 7:24 pm    Post subject: Version 3 error? Reply with quote

Hello

I'm developing a collection of components, and I'm using the thecnique described here http://www.infralution.com/phpBB2/viewtopic.php?t=207.

I used version 2.2.4 for several weeks wit no problems.

Today, I just replaced source code, upgrading to version 3.0.0 and I got lot of problems running compiled application that uses the licensed controls/components.

I generated a new set of keys and correctly set into the source code the newly created parameters (key strenght 10). At design-time everithing is ok!

At runtime
Code:
LicenseManager.IsValid(controlType, control, license)

returns False.

I found that if I edit my *.vbproj file, and delete
Code:
  <File
    RelPath = "licenses.licx"
    BuildAction = "EmbeddedResource"
  />

and then I delete licenses.licx file, everithing works fine again. But after some solution (and components) rebuild, I got IsValid error again.

Since I'm absolutely sure I changed nothing except version 3.0.0 source files upgrade, at this point I feel myself in a very intricated situation!

Please, help
Back to top
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Jul 17, 2006 10:27 pm    Post subject: Reply with quote

We have been using version 3 to license our own controls for a couple of months (pre release of version 3) using a similar mechanism and haven't encountered any problems. What source code language are you using (C# or VB)? Are you using VS2003 or VS2005?

Since you have changed the license keys to key strength 10 the old license keys will no longer be valid. Visual Studio compiles the license keys into the applications resources and doesn't rebuild these unless you force it to. One way of doing this is to use "Rebuild Solution". Deleting the "licx" file and readding it to the solution would have the same effect. I would expect you to have to do this once for each project that uses your control.

Since you have the source code it is relatively simple to debug the code to see what is happening. Find the following code and set a breakpoint in the method.

Code:
        public virtual EncryptedLicense GetLicense(LicenseContext context, Assembly assembly, Type type)
        {
            if (assembly == null) return null;
            EncryptedLicense license = null;
            string licenseKey = GetSavedLicenseKey(assembly, type);
            if (licenseKey != null)
            {
                license = LoadLicense(context, null, licenseKey);
            }
            return license;
        }


GetSavedLicenseKey retreives the license key from the applications resources. Check what this is returning. If this is null it means the license was not compiled into the applications resources. If it returns a key by LoadLicense returns null it means that the key was invalid. In this case check that the key is correct.

As a last resort you can revert back to using the Version 2 code (and strength 7 license keys) to verify that this is really the issue. In my experience you often think you have changed only one thing - but then discover the problem is due to some other change you made that was so inconsequential that you have forgotten it.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Tue Jul 18, 2006 6:38 am    Post subject: Reply with quote

Infralution wrote:
We have been using version 3 to license our own controls for a couple of months (pre release of version 3) using a similar mechanism and haven't encountered any problems.

I'm absolutely sure you haven't encountered problems. This is why I was surprised instead of disappointed!

Infralution wrote:
What source code language are you using (C# or VB)? Are you using VS2003 or VS2005?

I'm using VB.NET VS2003.

Infralution wrote:
Since you have changed the license keys to key strength 10 the old license keys will no longer be valid.

I know. I used a new set of keys/parameters.

Infralution wrote:
Visual Studio compiles the license keys into the applications resources and doesn't rebuild these unless you force it to. One way of doing this is to use "Rebuild Solution". Deleting the "licx" file and readding it to the solution would have the same effect. I would expect you to have to do this once for each project that uses your control.

As I explained in my previous post, I already followed all these steps before asking your help.
I deleted references to .licx file from .vbproj file
I deleted .licx file from project folder
I deleted obj folder
I deleted bin folder
I rebuild the whole solution

Infralution wrote:
As a last resort you can revert back to using the Version 2 code (and strength 7 license keys) to verify that this is really the issue.

Yes. Yesterday I reverted back to version 2 and everything is ok again.

Infralution wrote:
In my experience you often think you have changed only one thing - but then discover the problem is due to some other change you made that was so inconsequential that you have forgotten it.

Yes. I know! This is also my 20yrs programming experience Very Happy
I can confirm I only replaced EncryptedLicense.vb, EncryptedLicenseProvider.vb, EvaluationMonitor.vb and LicenseInstallForm.vb with corresponding version 3 files. Obviously, I also changed license key and parameters.

Today I'll try agin to use version 3. If I got no result, I'll send you via email a small solution trying to reproduce the problem, if you agree.

Thank you for your help.
Back to top
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Jul 19, 2006 12:04 am    Post subject: Reply with quote

Thanks for the sample project – it certainly made tracking down the issue much easier. There was indeed a problem in the VB converted source code for the EncryptedLicenseProvider which generates the runtime license keys. Our own controls are written in C# and so didn’t exhibit the problem. I have emailed you the fix. We have also updated our source code download to include the fix.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Licensing Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group