我写了一些WCF服务,用于开发和开发.调试目的我运行自托管.现在我有一个Web服务器,我正在考虑是否有任何理由改变我的服务在IIS 7下运行…如果是这样,怎么样?
解决方法
MSDN有一篇文章探讨了不同的
WCF hosting模型.以下是关于自托管的说法:
The following are the advantages of self-hosting:
- 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.
The following are the disadvantages of self-hosting:
- Limited availability: The service is reachable only when the application is running.
- Limited features: Self-hosted applications have limited support for high availability,easy manageability,robustness,recoverability,versioning,and deployment scenarios. At least,out-of-the-box WCF doesn’t provide these,so in a self-hosted scenario you have to implement these features yourself; IIS,for example,comes with several of these features by default.
(编辑:李大同)
【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!
|