|
Infralution Support Support groups for Infralution products
|
View previous topic :: View next topic |
Author |
Message |
Blaine Fields Guest
|
Posted: Sat Feb 18, 2006 10:10 pm Post subject: NET Framework 1.1 and 2.0 differences |
|
|
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
|
Posted: Sun Feb 19, 2006 10:40 pm Post subject: |
|
|
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 |
|
|
|
|
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
|