我是 WCF 编程模型的新手,我想使用netTcpBinding
. 在我问下面的问题之前,这是我的自定义绑定:
<customBinding>
<binding name="basic">
<security authenticationMode="UserNameForCertificate"/>
<binaryMessageEncoding/>
<httpsTransport/>
</binding>
</customBinding>
当我使用简单的控制台应用程序创建服务引用时,它会找到一个证书并要求我使用它。这样我就可以使用网络服务...
但是当我将绑定更改为netTcpBinding
与TransportWithMessageCredential
服务正在寻找证书并且找不到它时:
<netTcpBinding>
<binding name ="sdfsd">
<security mode="TransportWithMessageCredential">
<message clientCredentialType="UserName"/>
<transport clientCredentialType="None"/>
</security>
</binding>
</netTcpBinding>
ServiceCertificate.SetCertificate(StoreLocation.LocalMachine, StoreName.My, X509FindType.FindByIssuerName, "Contoso.com").
在这一点上,我使用 aCustomNameValidator
并以编程方式进行操作。
那么当我使用netTcpBinding
with时TransportWithMessageCredential
,为什么调用SetCertificate
找不到已安装的证书?我错过了什么吗?还是我必须添加一些东西?