WCF - Disabling security in nettcpbinding (c#)

余生颓废 提交于 2019-12-07 03:58:36

问题


I'm trying to make a self hosted WCF app that uses nettcpbinding but works in an environment without a domain.

It's just two regular windows pc's, one is the server and the other one will be the client. The problem with this is that when I try to get the client to connect it's rejected because of the security settings.

Can you please point me in the right direction as to how I can get this scenario to work?

Should I (if possible) disable security? Is there another (hopefully simple) way to accomplish this?

Regards,

Daniel


回答1:


If you'd like to disable security for testing purposes, in the App.config of the WCF project, change the security element to <security mode="None" />, e.g.:

<bindings>
  <netTcpBinding>
    <binding name="netTcpBindingConfig" transferMode="Buffered" maxReceivedMessageSize="5242880">
      <readerQuotas maxArrayLength="5242880" />
      <security mode="None" />
    </binding>
  </netTcpBinding>
</bindings>

If you have a client, update the service reference to sync the security settings. Keep in mind that you should use some level of security in production environments.



来源:https://stackoverflow.com/questions/2748115/wcf-disabling-security-in-nettcpbinding-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!