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:
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.
moshik.salem
Member
34 Points
124 Posts
Hosting Question
Jun 19, 2012 04:38 PM|LINK
Hi,
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)?
Thank You.
imghani
Member
154 Points
39 Posts
Re: Hosting Question
Jun 19, 2012 05:43 PM|LINK
salem,
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:
<%@ ServiceHost Language="C#" Debug="true" Service="WcfService1.Service1" CodeBehind="Service1.svc.cs" %>
Change it by pointing to your service file as follows:
<%@ ServiceHost Service="MyServiceLibrary.SampleService" %>
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.
Imran
WCF Tutorials
Peter pi - M...
Star
12871 Points
1786 Posts
Re: Hosting Question
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.
If you have any feedback about my replies, please contact msdnmg@microsoft.com
Microsoft One Code Framework