【发布时间】:2015-06-20 20:42:46
【问题描述】:
我有一个服务客户端库项目,它有自己的
app.config
.
我的 Web 应用程序中引用了这个项目。问题是我的 Web 应用程序抛出以下异常
Could not find endpoint element with name 'HttpEndPoint' and contract 'ServiceLibReference1.IDalService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this name could be found in the client element.
服务没有问题。如果我直接在 web 应用程序中引用我的服务,它可以正常工作,因为客户端配置被添加到 web.config。但我的要求是将它保存在一个单独的库项目中。
异常的原因是服务配置未添加到 web.config。我应该总是手动添加它们吗? VS 是否应该在引用服务库时将相应的配置添加到 web.config 中?还是我错过了什么?
谢谢
【问题讨论】:
标签: asp.net-mvc visual-studio-2010 wcf