无法控制 WCF 配置的 output.config 个名称
No control over output.config names for WCF configuration
在 Visual Studio 中,SOAP WCF,配置参数太严格了。
如果您在 Web 配置中设置端点的名称
<service name="...">
<endpoint name="**specific**" bindingName="whatever" contract="some IService"
bindingConfiguration="configuration Name"
binding="basicHttpBinding" bindingNamespace="some space"/>
端点名称将覆盖所有名称:output.config
中的端点名称、端点绑定配置和绑定名称
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="**specific**">
...
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="address"
binding="basicHttpBinding" bindingConfiguration="**specific**"
contract="some IService" name="**specific**" />
</client>
</system.serviceModel>
</configuration>
绑定配置和端点这两个名字没办法,按我想要的方式设置。例如,如果我在端点中设置 bindingName,它将使用它在所有三个地方创建 bindingName_ServiceName,同样我无法按照我想要的方式设置这两个端点名称和绑定配置名称。
如果我使用 svcutil 使用任何服务,这些名称通常是不同的。
有没有办法从 Visual Studio 控制它们? (即使通过代码完成也具有相同的效果。)
我需要这个,因为我的配置文件必须和我的一样。
问题的解决方式比您希望调查问题的简单性的方式更加复杂和令人费解。
第一部分,要在 output.config 中命名绑定,您需要使用 web.config 中端点的名称属性。
第二部分,要在 output.config 中给出端点名称,您需要覆盖端口命名,如
中所述
WSDL-first approach: How to specify different names for wsdl:port and wsdl:binding?
为什么在 output.config 和 web.config 中端点和绑定属性的含义完全混淆?你告诉我。
在 Visual Studio 中,SOAP WCF,配置参数太严格了。
如果您在 Web 配置中设置端点的名称
<service name="...">
<endpoint name="**specific**" bindingName="whatever" contract="some IService"
bindingConfiguration="configuration Name"
binding="basicHttpBinding" bindingNamespace="some space"/>
端点名称将覆盖所有名称:output.config
中的端点名称、端点绑定配置和绑定名称<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="**specific**">
...
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="address"
binding="basicHttpBinding" bindingConfiguration="**specific**"
contract="some IService" name="**specific**" />
</client>
</system.serviceModel>
</configuration>
绑定配置和端点这两个名字没办法,按我想要的方式设置。例如,如果我在端点中设置 bindingName,它将使用它在所有三个地方创建 bindingName_ServiceName,同样我无法按照我想要的方式设置这两个端点名称和绑定配置名称。
如果我使用 svcutil 使用任何服务,这些名称通常是不同的。
有没有办法从 Visual Studio 控制它们? (即使通过代码完成也具有相同的效果。)
我需要这个,因为我的配置文件必须和我的一样。
问题的解决方式比您希望调查问题的简单性的方式更加复杂和令人费解。
第一部分,要在 output.config 中命名绑定,您需要使用 web.config 中端点的名称属性。
第二部分,要在 output.config 中给出端点名称,您需要覆盖端口命名,如
中所述WSDL-first approach: How to specify different names for wsdl:port and wsdl:binding?
为什么在 output.config 和 web.config 中端点和绑定属性的含义完全混淆?你告诉我。