I have a WCF service (VS 2010, .Net 4.0) hosted as a Windows service.
What I want to do is this: I want a method which is in the service to be executed when the service is started.
I have a WCF service (VS 2010, .Net 4.0) hosted as a Windows service.
Share
I am not sure how you have used Windows Service to host your WCF service(s) but I would expect something like @SSamra described.
Anyway, below the line wherever you do .Open(); to open your service, you could initialize your wcf proxy and call your method.
Say your proxy is FirstWcfProxy, then you can do something like,
EDIT:
If you want to ensure the method is called as soon as the service is started, initialize your proxy below the line sHost.Open(); and invoke the method there, like I described above