开发者

Win7 self hosted WCF .net app makes incorrect firewall rule

I have a self hosted WCF service running in my .net App.

The service works fine when the firewall is configured correctly. However, the default rules added when the app first runs are not configured correctly and require changes by the user. When the app first runs on a machine it presents a "Windows Security Alert" dialog with the message "Windows Firewall has blocked some features of this program" and prompts to "Allow Access". If the user selects "Allow Access" then windows adds an Application exception to the firewall.

All of the above behavior is exactly as expected and is just what I want.

The problem is that the rule added to the firewall is not correct an开发者_如何学JAVAd does not enable the WCF service to work correctly. In the added rule "This Program" on the "Programs and Services" tab of the rule properties lists my WCF self hosted exe. This seems appropriate to me.

However, if I change this setting to "All programs that meet the specified conditions" then the rule works fine.

So, my question is in two parts.

a) Why is traffic to my app blocked by this rule when it correctly explicitly supports traffic to my EXE?

b) How do I fix the problem? Can I change something in the app so the rule will be added without restriction to my exe or to correctly allow traffic to my exe?

Thanks for your help.


a) because it is not your exe but the WCF daemon process taking inbound calls, by specifying any process, you are saying "any process" that would listen on port XXX will be added to exception list. Thus, the deamon process is added to exception list.

b)you can either add wcf daemon process to exception list , or add your exe's port to exception list. In case you are using net.tcp binding, deamon porcess is $frameworkDir/SMSvcHost.exe

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜