我有 mvc web 项目,我添加了另一个空项目,它包含所有服务,更像是存储库。
所以我遇到了抛出错误的问题,即使我在 Web.config 中添加了绑定,我也无法弄清楚为什么。
错误:
在 ServiceModel 客户端配置部分中找不到引用合同“DataService.ISDService”的默认端点元素。这可能是因为没有为您的应用程序找到配置文件,或者因为在客户端元素中找不到与此合同匹配的端点元素。
应用程序配置:
<configuration>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="SDEndPoint" />
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://services.local.com/Api.svc/wsHttp"
binding="wsHttpBinding" bindingConfiguration="SDEndPoint"
contract="ImageService.ISDService" name="SDEndPoint">
<identity>
<userPrincipalName value="nyc\pc" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
网络配置:
<client>
<endpoint address="http://services.local.com/Api.svc/wsHttp" binding="wsHttpBinding" bindingConfiguration="SDEndPoint" contract="ImageService.ISDService" name="SDEndPoint">
<identity>
<userPrincipalName value="nyc\pc" />
</identity>
</endpoint>
</client>
我不知道我哪里错了。