View previous topic :: View next topic |
Author |
Message |
alex
Joined: 22 Jan 2006 Posts: 4
|
Posted: Sun Jan 22, 2006 6:13 pm Post subject: VB.NET Windows Service with ILS |
|
|
Hi,
I just recenlty (yesterday) purchase your software and it is a great peace of code let me tell you. Now I have it working on my ASP.NET controls and follow your obfuscations instructions (not to rename the License classes, etc.) and it works like a charm. The same thing I have done with my C# client/server applications and also they work fine. Now I am trying to integrate ILS with my windows service programs and for some reason is not working as expected. I have tried the same software on an application (.exe) and it works fine but when I put it as a windows service the program just get stuck. I have tried to debug the program and see what's going on but I cannot even get an exception, it just hungs. So I am wondering if anyone has tested ILS within a windows service. Perhaps it gets crazy when it keeps the ILS library on memory???
My windows service check some external data every 10 seconds. I am using a Timer control and before I call my program to do the checking, I call the license checking:
Private Sub Timer1_Elapsed(ByVal sender As System.Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer1.Elapsed
'First CheckLicense
Dim CheckLicense As LicenseILS = New LicenseILS
CheckLicense.ValidateLicense()
...
End Sub
<LicenseProvider(GetType(Infralution.Licensing.EncryptedLicenseProvider))> _
Public Class LicenseILS
Const _licenseParameters As String "my license parameters"
Public Function ValidateLicense()
EncryptedLicenseProvider.SetParameters(_licenseParameters)
Dim theLicense As License = Nothing
If Not LicenseManager.IsValid(GetType(LicenseILS), Me, theLicense) Then
...
End If
If theLicense Is Nothing Then
Dim monitor As New EvaluationMonitor("JPayDeposits")
If monitor.DaysInUse > 40 Or monitor.Invalid Then
LicenseManager.Validate(GetType(LicenseILS))
End If
Else
If CType(theLicense, EncryptedLicense).ProductInfo = "F;1" Then
...
End If
End If
End Function
End Class
Any help will be appreciated, thanks |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Mon Jan 23, 2006 4:23 am Post subject: |
|
|
My guess is that you are probably attempting to display the LicenseInstall dialog (or other message box) when you don't find a license. Windows services are not UserInteractive and cannot show dialogs or windows. You will probably need to install the license key from your installation program and simply check it from the service. _________________ Infralution Support |
|
Back to top |
|
|
alex
Joined: 22 Jan 2006 Posts: 4
|
Posted: Mon Jan 23, 2006 4:29 am Post subject: |
|
|
actually I do not think I am calling the LicenseInstall Dialog. The code I posted is the only thing I do. Therefore must be something else. I have exactly the same program as an application executable and it works just fine. As a Windows Service it doesn't which is very strange... |
|
Back to top |
|
|
Infralution
Joined: 28 Feb 2005 Posts: 5027
|
Posted: Mon Jan 23, 2006 4:37 am Post subject: |
|
|
Try attaching the debugger to the service (before it hangs) then stop the debugger and take a look at the callstack. If this fails you may have to resort to debugging by exclusion (ie take out code until it doesn't hang) _________________ Infralution Support |
|
Back to top |
|
|
|