>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:
oWindowsService.oApp = oApp
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