Avatar of Dan Violet Sagmiller (He/Him)
Dan Violet Sagmiller (He/Him)
Flag for United States of America asked on

C# wcf void main

I have a C# WCF project (vs2010u) and I need to be able to point to a start up method.  Most applications have static void main, but I don't see that here.

How can I get a WCF service to automatically execute a particular method on startup?

Also, is there a close event that I can have it respond to as well?

Thanks.

WCFC#

Avatar of undefined
Last Comment
Dan Violet Sagmiller (He/Him)

8/22/2022 - Mon
kaufmed

How are you hosting the service--in IIS or in a self-hosted setup (e.g. console application or windows service)?
Dan Violet Sagmiller (He/Him)

ASKER
I've been using debug mode, in VS2010 so far, just now paying attention to the fact it was going through IIS.  However, I'm planning on building this for a console app.  I'm guessing that the console app will call it on its void main.
ASKER CERTIFIED SOLUTION
kaufmed

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Dan Violet Sagmiller (He/Him)

ASKER
I'll add this line:  I didn't realize some of the difficulties in producing the console app version.  The first I tried was windows service, which was a huge pain.  Then I tried console app from http://msdn.microsoft.com/en-us/library/ms731758.aspx, and then called the initializer from the main() in the console app.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy