在 Windows 进程激活服务 (WAS) 和 IIS 7 之间进行选择

Choosing between Windows Process Activation Services (WAS) and IIS 7

我正在编写一个 WCF 服务,它将 运行 在服务器计算机上 (Windows 10 OS)。要托管该服务,我正在考虑 WAS 和 IIS 7。我知道早期版本的 IIS 仅支持 HTTP 协议,但 IIS 7 及更高版本也支持 TCP/IP。

我的 WCF 服务现在将由 desktop/mobile WCF 客户端使用,所以我打算暂时只使用 TCP/IP。但它可能会在未来扩展到包括 HTTP 以支持 Web。

请告知我应该使用哪个主机 - WAS 还是 IIS?

两者都需要。

来自文档 (https://technet.microsoft.com/en-us/library/cc735229(v=ws.10).aspx):

Windows Process Activation Service (WAS) manages application pool configuration and the creation and lifetime of worker processes for HTTP and other protocols. The World Wide Web Publishing Service (W3SVC) and other services depend on WAS.

您必须安装所需的激活(程序和功能 | 打开和关闭 windows 功能 | .Net 框架高级服务 | WCF 服务),创建服务,将其托管在 IIS 中,配置 WCF 和在 IIS 中配置绑定。 您可以使用 IIS 管理(在 IIS 管理器的右上角,在编辑站点 | 绑定...下)或命令行工具配置绑定,如下所示:

%windir%\system32\inetsrv\appcmd.exe set site "Default Web Site" -+bindings.[protocol='net.tcp',bindingInformation='808:*']

此处提供命令行示例和更多信息:

https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/how-to-install-and-configure-wcf-activation-components

这里:

https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/how-to-host-a-wcf-service-in-was