Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Windows Service inside a dll
Message
De
02/09/2013 18:42:24
 
 
À
02/09/2013 14:28:29
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:
01581841
Message ID:
01581850
Vues:
34
Michel, what we've done is to keep this ServiceBase class in the EXE as it is (MyService in the example I posted previously), but when MyService starts (in the OnStart() method), we create new instances of classes that live in our Framework, which themselves have Start/Stop methods. These other Framework classes are not sub-classed from ServiceBase (nor do they need to be). And everything works. I guess the key to this working is that those Framework classes are not sub-classed from ServiceBase (judging from your post, that can't be done, but I've never tested it, so I don't know for sure).

~~Bonnie


>Now that I have tested my EXE which includes my Windows Service base class, it was time to move it at the framework level. So, I have to move the Windows Service base class at the framework level and I simply changed two lines in my EXE to point to the framework location for the instantation of the class instead of the local copy of that class inside the EXE. Surprise, it doesn't work. It cannot start either from the EXE or from the Services interface. I assume this is because a Windows Service cannot be hosted inside a DLL. Is that correct? If yes, how can I move that class up there and have it working? If not, what kind of configuration settings might be required to be adjusted somewhere?
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform