[英]Dynamically add reference of WCF service
I am creating a WCF service and Client application. 我正在创建WCF服务和客户端应用程序。 I want to use the service in the client application.
我想在客户端应用程序中使用该服务。
The location where the WCF service will be hosted is not yet finalized. WCF服务的托管位置尚未最终确定。 I want to dynamically add the reference of the hosted WCF service without building the client application.
我想动态添加托管WCF服务的引用,而无需构建客户端应用程序。 How can I achive this?
我该如何实现?
Thanks, 谢谢,
Ram 内存
Do this: 做这个:
I think this would be by far the easiest solution. 我认为这是迄今为止最简单的解决方案。
If you insist on a dynamic proxy - there's a sample of a WCF dynamic proxy here: 如果您坚持使用动态代理-这里有一个WCF动态代理示例:
http://code.msdn.microsoft.com/netfxsamples/Wiki/Print.aspx?title=WCF%20samples&version=8&action=Print http://code.msdn.microsoft.com/netfxsamples/Wiki/Print.aspx?title=WCF%20samples&version=8&action=Print
Scroll down a bit to find the sample. 向下滚动一点以找到示例。 It was C# code to show you how to dynamically create a WCF proxy all in code.
这是C#代码,向您展示如何在代码中动态创建WCF代理。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.