在WCF中的separete项目中配​​置端点

时间:2015-10-14 09:42:22

标签: asp.net-mvc wcf castle-windsor

我需要将容器注册端点(Windsor)从Global.asax文件转移到新项目。我想从Web.config文件中检索一个部分,其中定义了端点,但我不知道如何从separete项目到达该文件和部分。我尝试过这样的事情:

 ClientSection clientSection = new MvcApplication().Application.Get((ClientSection) ConfigurationManager.GetSection("system.serviceModel/client"))

但似乎这是错误的道路。任何想法如何将一个项目中的Web.config部分复制到另一个项目的配置文件中?

1 个答案:

答案 0 :(得分:0)

尝试使用此代码获取客户端部分:

ClientSection clientSection = 
ConfigurationManager.GetSection("system.serviceModel/client") as ClientSection;
相关问题