简体   繁体   English

WCF-自托管还是IIS首选项?

[英]WCF - Self hosted or IIS Preference?

I am relatively green with C# and WCF. 我对C#和WCF比较满意。 I have landed on a project where I am creating self hosted WCF services running as Windows services but am starting to wonder if I should use IIS instead (which we don't currently use) as managing all of these services could eventually get cumbersome. 我进入了一个项目,在该项目中,我创建了作为Windows服务运行的自托管WCF服务,但是开始怀疑是否应该改用IIS(我们目前不使用IIS),因为管理所有这些服务最终会变得很麻烦。

Despite my best efforts, I have yet to find any definitive information about why I might favor one approach over the other. 尽管我已尽力而为,但我仍未找到任何明确的信息来说明为什么我可能偏爱一种方法。 The services are primarily used for utility stuff like resizing images, retrieving files, etc. and are called by both C# and Java clients. 这些服务主要用于实用工具,例如调整图像大小,检索文件等,并由C#和Java客户端调用。

Thanks 谢谢

The shortest answer would be 'it depends'. 最简单的答案是“取决于”。 On your requirements. 根据您的要求。 You can self host without problems, but IIS will manage resources more effectively and enable you to fine tune stuff more easily than self-hosted. 您可以自托管,没有问题,但是IIS将比自托管更有效地管理资源,并使您可以更轻松地微调内容。

For instance, in IIS would be more simple to deploy a new version or remove and old one. 例如,在IIS中,部署新版本或删除旧版本会更加简单。

Either way is fine. 两种方法都可以。

Generally, using the builtin IIS hosting capabilities can make deployment and configuration simpler for you. 通常,使用内置的IIS托管功能可以使您的部署和配置更简单。 Also you have the activation model of http.sys - which means IIS will start the necessary process for you when an appropriate message arrives. 另外,您还有http.sys的激活模型-这意味着IIS将在收到适当的消息时为您启动必要的过程。

Clients of any platform can connect to the WCF services regardless whether they are self-hosted or IIS hosted. 任何平台的客户端都可以连接到WCF服务,无论它们是自托管还是IIS托管。

ps: how to allow IIS-hosted WCF services to store their configuration data in distinct xxx.config files ps: 如何允许IIS托管的WCF服务将其配置数据存储在不同的xxx.config文件中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM