Search code examples
windowsvisual-studiowindows-8automated-testswindows-firewall

Disable Windows Firewall popup for automated tests


We are running automated tests from Visual Studio. Some of these tests needs to communicate with a temporary Redis server and we therefore launch redis-server.exe in a JobObject during test execution.

The redis-server.exe executable file is deployed to the test run directory by declaring [DeploymentItem("redis-server.exe")].

This works fine except that for every test run an annoying Windows Firewall popup is displayed:

enter image description here

Is it possible to prevent this popup from being displayed?

Would it, for example, be possible to tell Windows that any redis-server.exe located under a specific directory is allowed to use the network?

This is particularly annoying because the dialog fulfills no purpose in this case. No matter whether I choose to click on Allow access or Cancel or even just ignore the popup, the tests will still complete. However, a new firewall rule is created every time.


Solution

  • No idea if it's actually possible, but the best solution would be to change the listening settings on the temporary server so that it listens on 127.0.0.1 instead of 0.0.0.0, causing it to only accept connections from the local machine. For a test it's perfectly acceptable, and such a listening will never trigger firewall warnings.