WCF - 在NetTcpBinding的禁用安全(C#) [英] WCF - Disabling security in nettcpbinding (c#)
问题描述
我试图做一个自我托管使用NetTcpBinding的,但没有域的环境中工作的WCF应用程序。
I'm trying to make a self hosted WCF app that uses nettcpbinding but works in an environment without a domain.
这只是两个普通的Windows PC的,一个是服务器而另一个将是客户端。这样做的问题是,当我试图让客户机连接它拒绝了,因为安全设置。
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?
问候,
丹尼尔
推荐答案
如果您想为测试目的禁用安全,在WCF项目的App.config,更改安全要素到<安全模式=无/>
,例如:
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.
这篇关于WCF - 在NetTcpBinding的禁用安全(C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!