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 

VB.NET Windows Service with ILS

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



Joined: 22 Jan 2006
Posts: 4

PostPosted: Sun Jan 22, 2006 6:13 pm    Post subject: VB.NET Windows Service with ILS Reply with quote

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 Shocked
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Jan 23, 2006 4:23 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
alex



Joined: 22 Jan 2006
Posts: 4

PostPosted: Mon Jan 23, 2006 4:29 am    Post subject: Reply with quote

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
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Jan 23, 2006 4:37 am    Post subject: Reply with quote

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
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