问题描述
我创建了这项服务:现在我想主持那个IIS上的服务。
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.
如果我想在IIS上托管WCF服务应用程序怎么办?
What if I want to host WCF service application on IIS?
在IIS上托管的目的是因为我想在Android应用程序上使用该服务。
Purpose of hosting on IIS is because I want to consume that service on android application.
推荐答案
MSND使用方法。您不必单独创建服务库和单独托管应用程序。您所能做的就是创建一个简单的Visual Studio WCF服务应用程序项目,其中包含一个SVC文件,该文件将帮助您在IIS上托管并在同一项目中创建服务。
步骤:
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:
- 创建新的Visual Studio WCF服务应用程序
- 此WCF服务Project已包含SVC文件,该文件用于在IIS上托管服务。
- 创建服务。
- 编译服务项目。
- 使用inetmgr windows快捷方式打开IIS(win + r)
- 在IIS上创建网站/ Web应用程序并直接指向WCF服务应用程序项目。 / li>
- 选择适当的应用程序池,具体取决于您的.NET Framework。
- 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.
这篇关于IIS上的主机WCF服务应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!