【发布时间】:2013-08-15 16:22:08
【问题描述】:
在我的 Web 应用程序中,我有一个服务引用(不是 Web 服务引用)。
[DebuggerStepThrough]
[GeneratedCode("System.ServiceModel", "4.0.0.0")]
public partial class LoginClient : ClientBase<Login.LoginClient>, Login.LoginSvc
{
public LoginClient() {
EndpointAddress address = new EndpointAddress(ConfigurationManager.AppSettings["login_svc"]);
this.Endpoint.Binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
this.Endpoint.Address = address;
}
}
基本上,我在 AppSettings 中有“login_svc”。但是,它会引发流动异常:
我不想将服务配置添加到 web.config system.servicemodel....相反,我只想使用 url 的 appsettings。我该怎么做?
【问题讨论】:
-
我相信像 this 这样的东西是你要找的。span>
标签: c# asp.net wcf service-reference