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 

NET Framework 1.1 and 2.0 differences

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





PostPosted: Sat Feb 18, 2006 10:10 pm    Post subject: NET Framework 1.1 and 2.0 differences Reply with quote

In MC++, the inital license presence testing in accomplished with this code:

License* license;
if( !LicenseManager::IsValid( this->GetType(), this, &license ))
{
. . .
}

In VS 2005 using NET Framework 2.0, this code works and if a license is present in the same directory that the program is running, the IsValid() method returns true and the "license" variable is assigned a value otherwise IsValid returns false and "license" remains null.

In VS 2003 using NET Framework 1.1, the code compiles but IsValid ALWAYS returns true and "license" is ALWAYS null, whether a license is present or not.

Any ideas for a workaround for NF 1.1?
Back to top
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Sun Feb 19, 2006 10:40 pm    Post subject: Reply with quote

We test ILS under both .NET 1.1 and .NET 2.0. Our own controls which use the licensing system are authored using .NET 1.1. So I don't think it is a framework issue. One thing that will cause IsValid to return true while leaving license null is if you forget to add the LicenseProvider attribute to the class you are licensing.

You should also use __typeof(MyClass)) rather than this->GetType(). this->GetType will return the final type of actual instance. So if someone derives from your class it will return the derived type. Since their derived type is not licensed IsValid will again always return true.

If you are licensing an application (ie not a control/component) then the latest release of ILS (2.2.0) allows a simpler approach where you don't have to use the LicenseManager class eg

Code:
 
' create the license provider used to get/install the license
'
Dim sProvider As New EncryptedLicenseProvider
Dim sLicense As EncryptedLicense = sProvider.GetLicense(LICENSE_PARAMETERS, LICENSE_FILE)

' check if there is a valid license for the application
'
If sLicense Is Nothing Then
    ' show install form etc
End If


Check out the new samples and documentation for this method.
_________________
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