自定义托管和“支持 Silverlight 的 WCF 服务”
我希望我的 WP7 能够与本地计算机上的服务通信。由于各种原因,如果将此服务托管在自定义主机(即本地运行的应用程序)中会更方便。但是,如果我正确理解“启用 Silverlight 的 WCF 服务”需要 ASP.NET 兼容性,因此必须托管在 IIS 中,这是正确的吗?
如果是这样,是否有办法解决这个问题并在自定义主机中运行“启用 Silverlight 的 WCF 服务”?
I'd like my WP7 to be able to talk to a service on my local computer. For various reasons it would be more convenient if this service was hosted in a custom host, i.e. an app running locally. However, if I understand correctly "Silverlight-enabled WCF service" need asp.net compatibility, therefore must be hosted in IIS, is this correct?
If so, is there anyway to work round this and get a "Silverlight-enabled WCF service" running in a custom host?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
支持 Silverlight 的 WCF 服务只是常规 WCF 服务的简化项模板。最初添加它是因为 Silverlight 不支持 WCF 服务的默认绑定,并且给新的 Silverlight 开发人员带来了很多焦虑。您应该能够在常规项目(例如控制台应用程序)中使用常规 WCF 项目,并且只需调整绑定即可。
(还值得注意的是,启用 Silverlight 的 WCF 模板使用单个代码文件,而不是将服务接口与类实现分开。)
The Silverlight-enabled WCF Service is just a simplified item template from a regular WCF service. It was originally added because the default binding for WCF services wasn't supported in Silverlight, and caused a lot of angst for new Silverlight developers. You should be able to use the regular WCF item in a regular project (e.g. console app) and you'll just have to adjust the bindings.
(Also of note is that the Silverlight-enabled WCF template uses a single code file instead of separating out the service interface from the class implementation.)