惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Y
Y Combinator Blog
GbyAI
GbyAI
爱范儿
爱范儿
H
Hackread – Cybersecurity News, Data Breaches, AI and More
C
Check Point Blog
M
MIT News - Artificial intelligence
量子位
宝玉的分享
宝玉的分享
MongoDB | Blog
MongoDB | Blog
V
Visual Studio Blog
罗磊的独立博客
F
Fortinet All Blogs
美团技术团队
博客园_首页
博客园 - 【当耐特】
L
LangChain Blog
月光博客
月光博客
腾讯CDC
The Cloudflare Blog
D
Docker
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
WordPress大学
WordPress大学
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报

博客园 - DataFlow

word break 在不同浏览器中的表现 系统架构 创造HTTPS的是个神 为Chrome开发插件提高工作效率 Javascript 控制style 小结 svcutil 生成代理类时的问题 xeam Build Definition Extension uninstall 卸载 屏蔽电信流氓弹出广告 正则替换中的一个Bug SQL server 性能相关 SQL Express 相关 时间格式 输出一个在没有.Net 环境的机器也可以跑得安装包 再谈性能力 SCOM Configuration NumSamples and Absolute XML中的时间 decimal.Round 的区别 Dos中常用的命令 反序列化怪现象,数组无父
Wcf客户端配置里Endpoint的Name属性无效
DataFlow · 2013-02-17 · via 博客园 - DataFlow

<client>
      <endpoint address="http://..."
        binding="basicHttpBinding" bindingConfiguration="..."
        contract="..." name="endpoint1" />

</clent>

之后, 当我们在程序里读取endpoint.Name时,却发现怎么也找不到endpoint1,会返回BindingName_ContractName

code:

 Code:

private ServiceEndpoint CreateServiceEndpoint()
{
    TypeLoader loader = new TypeLoader();
    ServiceEndpoint serviceEndpoint = new ServiceEndpoint(loader.LoadContractDescription(this.contractType));
    if (this.address != null)
    {
        serviceEndpoint.Address = new EndpointAddress(new Uri(this.address), this.identity, new AddressHeader[0]);
    }
    if (this.binding != null)
    {
        serviceEndpoint.Binding = this.binding;
    }
    if (this.configurationName != null)
    {
        new ConfigLoader().LoadChannelBehaviors(serviceEndpoint, this.configurationName);
    }
    ComPlusTypedChannelBuilderTrace.Trace(TraceEventType.Verbose, 0x5001e, "TraceCodeComIntegrationTypedChannelBuilderLoaded", this.contractType, this.binding);
    return serviceEndpoint;
}

完全没有Name的什么事,算不算重大bug, 所以干脆直接配置成"bindingName+_+contractName",以免混淆视听