WCF自宿主所需的组件
本文关键字:组件 宿主 WCF | 更新日期: 2023-09-27 17:53:09
我的服务(TCP)之前已经安装在IIS7中,这是它的要求:
Internet Information Services
- Web Management Tools (all)
- Wold Wide Web Services
-- Application Development Features (all - CGI)
-- Common Http Features (all)
-- Health and Diagnostics
--- HTTP Logging
--- Request Monitor
-- Performance Features
--- Static Content Compression
-- Security
--- Basic Authentication
--- Client Certificate Mapping Authentication
--- IIS Client Certificate Mapping Authentication
--- Request Filtering
--- URL Authorization
--- Windows Authentication
Microsoft .NET framework 3.0
- Windows Communication Foundation HTTP Activation (for WAS)
- Windows Communication Foundation Non-HTTP Activation
Windows Process Activation Service
- .NET Environment
- Configuration APIs
- Process Model
现在我已经改为。net WCF Selfhost,这让我想知道需要哪些组件?我是否可以移除"互联网资讯服务"及"视窗进程激活服务"?
是所有我需要保持。net框架X.0?
WCF Self Hosting绝对不需要IIS或任何其他服务。它只需要。net框架版本(3.5及以上)支持WCF。TCPBinding支持多种特性,包括可靠性、事务和安全性。
——. net 3.5或以上版本
——Basic/Windows Authentication.
—创建代理(svcutil/Channelfactory)足以访问Selfhosted wcf服务
——不需要IIS或任何其他服务
希望这有助于…
是的,WCF自托管就是自托管。您不依赖于IIS或WPA。
看看msdn上的这个链接。您可以使用第8点提到的ServiceHost来制作实际的托管组件。
下面是一个自托管WCF服务作为HTTP服务的代码片段。
var baseAddress = new Uri("http://localhost:3124/");
var host = new WebServiceHost(typeof(SSOUser), baseAddress);
var sep = host.AddServiceEndpoint(typeof(ISSOUser), new WebHttpBinding(), "");
sep.Behaviors.Add(new WebHttpBehavior());
host.Open();
与IIS托管等相比,您可能会错过的是,您需要将服务主机放在正在运行的应用程序或windows服务中,以使其持续侦听端点。但这可能并不让你感到惊讶:)
任何添加组件。WCF selfhost所需框架仅3/3.5/4/4.5