简体   繁体   English

向Windows防火墙添加程序例外仍然不允许连接

[英]Add Program Exception to Windows Firewall still does not allow connections

I can't seem the get a program exception to work in Windows Firewall for my DotNet WCF executable. 对于DotNet WCF可执行文件,似乎无法在Windows防火墙中正常工作的程序例外。 I have this command: 我有以下命令:

netsh.exe advfirewall firewall add rule name="MyApp Rule" dir=in action=allow protocol=TCP program="c:\myapp\myapp.exe"

However, I still cannot connect from a remote computer (on the same subnet). 但是,我仍然无法从远程计算机(在同一子网上)进行连接。 It works fine if I specify an exact port number, for example: 如果我指定确切的端口号,则可以正常工作,例如:

netsh.exe advfirewall firewall add rule name="MyApp Rule" dir=in action=allow protocol=TCP localport=12345

I have tried it from both the Command Line and the Firewall Exception GUI. 我从命令行和防火墙例外GUI都尝试过。

I have tried on several different machines with several different operating systems including 2008R2 and 2012R2. 我曾尝试在具有2008R2和2012R2几种不同操作系统的几种不同机器上进行尝试。

Is there some special trick I need to know? 我需要知道一些特殊的技巧吗?

Ok, I learned that the WCF listeners run in the System context not in the application's context so that was the reason specifying the WCF executable did not work. 好的,我了解到WCF侦听器在系统上下文中而不是在应用程序的上下文中运行,因此这是指定WCF可执行文件不起作用的原因。 Interestingly if I specify program=system, that works. 有趣的是,如果我指定program = system,那行得通。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 InstallShield可以将应用程序添加到Windows防火墙例外列表吗? - Can InstallShield add application to Windows Firewall exception list? C#上的异常-但程序仍然可以使用 - Exception on C# - but program still works 为什么防火墙会阻止localhost连接? - Why are localhost connections blocked by the firewall? 如何通过 Windows 防火墙允许 .NET Core 控制台应用 FTP 连接? - How do I allow a .NET Core console app FTP connection through Windows Firewall? Control.Bindings.Add问题,异常告诉我程序无法绑定到不存在的列(但确实存在) - Control.Bindings.Add problem, exception telling me that the program cannot bind to a column that does not exist (but it does) NetTcpBinding和Windows 7防火墙 - NetTcpBinding and Windows 7 firewall Windows Mobile:Finalizer中的异常终止程序 - Windows Mobile: exception in Finalizer terminates program Windows安全警报Windows防火墙已阻止此程序消息的某些功能出现在我的应用程序的每个新版本中 - windows security alert windows firewall has blocked some features of this program message coming for every new build of my application 以另一个用户身份运行.Net程序,但仍访问已登录Windows用户 - Run .Net program as another user, but still access logged in windows user Windows上的C#在程序仍在运行时更新程序 - c# on windows updating a program while it's still running
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM