Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Windows Service stopping immediately
Message
De
04/09/2013 09:27:17
 
 
À
03/09/2013 20:41:54
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01581778
Message ID:
01582064
Vues:
45
>No, because as I said in my other post, I have only one class sub-classed from ServiceBase and that is in the EXE. I have a feeling that you're not understanding what I'm trying to tell you about how to architect this. I don't know what else to say except to look closely again at what I posted earlier. Let me try to elaborate with just a little more code. This is basically what I posted before, but I've added some comments and other sample code:

That is the only way I was able to make it work. It does, but I cannot benefit from inheritance from a class I have in my framework such as the flexibility to use overrrides and overloads. So, I have to call those methods manually. Also, the class in the framework need to call those methods. So, as the class cannot know at design time what would be the class which will call it at run time, I can only define something like:
Public oWindowsService As Object = Nothing
So, basically, I loose intellisense on such line:
            ' Assign oApp to the Windows Service
            oWindowsService.oApp = oApp

            ' If we have custom client initialization
            If Not oWindowsService.Initialize() Then
                Return False
            End If
But, I do believe .NET should support hosting a Windows Service class in a DLL. That would allow me to benefit from such OOP approach. It is true however that this would require that the startup of the application would be controlled right away from a Windows Service, which you suggest you prefer not to. So, as I have it now, it works and the control is inside the application at first which creates an instance of the Windows Service which creates an object of the framework.

Thanks
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform