WCF 服务应用程序和 WCF 服务库之间有什么区别? [英] What is the difference between a WCF Service Application and a WCF Service Library?
问题描述
我正在开发 WCF Web 服务,我使用 WCF 服务应用程序模板来完成这项工作.
I am developing a WCF web service and I used the WCF Service Application template to do that.
创建WCF 服务应用程序"是否满足此要求?与 WCF 服务应用程序相比,创建 WCF 服务库有哪些优势?
Does creating a "WCF Service Application" fulfill this requirement? What are the advantage of creating a WCF Service Library over a WCF Service Application?
推荐答案
服务应用程序包括已为您设置的网站主机.服务库是宿主可以引用和启动的服务库.
A service application includes a website host already setup for you. A service library is a library of services that a host can reference and startup.
如果您从服务库(推荐)开始,您可以选择您想要的任何主机(Windows 服务、IIS/ASP.NET,甚至是控制台应用程序),并且您只需从新主机中引用您的库.选择服务应用程序会将您的主机限制为仅使用 IIS/ASP.NET(虽然这可能符合您的目的,但会限制您可以使用的协议).
If you start with a service library (recommended) you can then choose any host you wish (a windows service, IIS/ASP.NET, or even a console application) and you'd just reference your library from your new host. Choosing a Service Application limits your host to just IIS/ASP.NET (though this might be ok for your purposes, but will limit the protocols you can use).
编辑:自从我写这篇文章以来,IIS 中的变化允许在 ASP.NET 激活的服务上使用更广泛的协议,因此选择服务应用程序的限制比以前少得多.
Edit: Changes in IIS since I wrote this allow for a wider variety of protocols on ASP.NET activated services, so choosing a service application is much less limiting than before.
这篇关于WCF 服务应用程序和 WCF 服务库之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!