问题
I have created this service: http://www.c-sharpcorner.com/UploadFile/dhananjaycoder/four-steps-to-create-first-wcf-service-for-beginners/ and now I want to host that service on IIS.
The solutions I came across are creating service library and then creating a separate hosting project.
What if I want to host WCF service application on IIS?
Purpose of hosting on IIS is because I want to consume that service on android application.
回答1:
MSND How-to for hosting the WCF on IIS. You don't have to create Service library seperatly and hosting application seperately. All you can do is create a simple Visual studio WCF Service Application Project which includes a SVC file which will help you to host on IIS and create Services in the same project. Steps:
- Create a new Visual Studio WCF Service Application
- This WCF Service Project already contains the SVC file, which is used for hosting the services on IIS.
- Create your services.
- Compile the Service Project.
- Open the IIS using inetmgr windows shortcut (win + r)
- Create a website /web application on IIS and point the WCF Service Application Project directly.
- Select Appropriate Application Pool, depending on your .NET Framework.
来源:https://stackoverflow.com/questions/20674398/host-wcf-service-application-on-iis