Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Jun 21, 2012 02:25 AM by Peter pi - MSFT
Jun 19, 2012 04:38 PM|LINK
I have a question about WCF service hosting and to be more specific:
when i am adding new web site on my solution and selects WCF service, how excatcly do the management of the hosting?
because when i choose to host a wcf service using windows forms i have the ServiceHost class which i can manage my self, so how do
the management when i choose the WCF Service when i choose the option of new web site(ASP.NET)?
Jun 19, 2012 05:43 PM|LINK
For a service to host, we normally require atleast a managed process, a ServiceHost instance and one Endpoint configured.
In case of hosting on IIS, we normally got the benefit that we don't need to code everything.
You can add a "WCF Service Application" project to your solution. You will get a Service1.svc file. Right click and choose "View Markup". You will see the only line like this:
Change it by pointing to your service file as follows:
and, define an endpoint in web.config file. You may also need to delete the code behind file for .svc.
You may run and test it in WCF Test Client application.
Jun 21, 2012 02:25 AM|LINK
If you add a new web site on your solution in VS, then you could add a WCF service to this web site, generally it very easy for you host web site which contains this WCF service (.svc file) in IIS, you could also host this WCF service in Windows form programmatically
by using ServiceHost class.