为什么/如何自承载WCF服务迁移到IIS7? [英] Why/how to migrate self-hosted WCF service to IIS7?

查看:117
本文介绍了为什么/如何自承载WCF服务迁移到IIS7?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经写了一些WCF服务,这为开发和放大器;调试的目的我作为自托管。现在,我已经有了一个Web服务器和我考虑是否有任何理由改变我的服务,IIS 7下运行?如果是这样,怎么样?..

I've written some WCF services, which for development & debugging purposes I ran as self-hosted. Now I've got a web server up and I'm considering whether there is any reason to change my services to run under IIS 7... and if so, how?..

推荐答案

MSDN有探索不同的 WCF托管车型。下面是它有什么看法自托管:

MSDN has an article that explores the different WCF hosting models. Here is what it has to say about Self Hosting:

以下是自托管的优点:


  • 易于使用:只用几行代码,你有你的服务运行

  • 灵活:您可以轻松地通过Open()和ServiceHost的关闭()方法来控制你的服务的生命周期

  • 便于调试:调试是在自托管环境中托管WCF服务提供了一个熟悉调试的方式,而不必附加到激活您的服务单独的应用程序

  • 易于部署:一般情况下,部署简单的Windows应用程序一样XCOPY一样容易。你不需要在服务器农场任何复杂的部署方案,等等,来部署一个简单的Windows应用程序,作为一个WCF的ServiceHost

  • 支持所有的绑定和运输:自托管不限制你出的现成绑定和任何传输。在Windows XP和Windows Server 2003,IIS限制你只能HTTP

  • Is easy to use: With only a few lines of code you have your service running.
  • Is flexible: You can easily control the lifetime of your services through the Open() and Close() methods of ServiceHost.
  • Is easy to debug: Debugging WCF services that are hosted in a self-hosted environment provides a familiar way of debugging, without having to attach to separate applications that activate your service.
  • Is easy to deploy: In general, deploying simple Windows applications is as easy as xcopy. You don't need any complex deployment scenarios on server farms, and the like, to deploy a simple Windows application that serves as a WCF ServiceHost.
  • Supports all bindings and transports: Self-hosting doesn't limit you to out-of-the-box bindings and transports whatsoever. On Windows XP and Windows Server 2003, IIS limits you to HTTP only.

以下是自托管的缺点:


  • 有限公司可用性:服务是应用程序正在运行,只有当访问

  • 有限公司的特点:自我托管应用程序已经限制了高可用性,易管理性,鲁棒性,可恢复性,版本控制和部署方案的支持。至少,外装即用WCF不提供这些,所以在自托管情况下,您必须自己实现这些功能; IIS,例如,在默认情况下带有一些的这些功能。

这篇关于为什么/如何自承载WCF服务迁移到IIS7?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆