In connection with my handheld > server app using Web API RESTful methods problem discussed here (Does an ASP.NET Web API app need to be installed into the "real" IIS before a handheld device can access its RESTful methods?), I tried to verify I wasn't having a firewall problem by using the shell command delineated here: http://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx, explicitly:
netsh firewall add portopening TCP 80 IISExpressWeb enable ALL
I also did it using port 777, as that is the one I've got set up in applicationhost.config:
<bindings>
<binding protocol="http" bindingInformation="*:28642:localhost" />
<binding protocol="http" bindingInformation="*:777:192.168.125.50" />
<binding protocol="https" bindingInformation="*:44300:localhost" />
</bindings>
Doing so, I got this fingerwag from the command shell:
IMPORTANT: Command executed successfully. However, "netsh firewall" is deprecated; use "netsh advfirewall firewall" instead.
So, I then entered the following (the traditional/default port 80, as shown in Hanselmann's post, and then the one I added to applicationconfig.host when the trad was failing (777)), one after the other:
netsh advfirewall firewall add portopening TCP 80 IISExpressWeb enable ALL
netsh advfirewall firewall add portopening TCP 777 IISExpressWeb enable ALL
However, after entering the command shell's command (or suggestion), I then got the following feedback from the cmd shell (both times):
The following command was not found: advfirewall firewall add portopening TCP 80 IISExpressWeb enable ALL.
So it tells me to use the newfangled command, then says there's no such thing! What is the story on this? Is there a way to actually use the new command? Is my syntax wrong with it, or...???
Typing
netsh /?
at a command prompt explains the options available, and that to view information on the option you want to typenetsh <option> /?
. Doing so withYou can apply
<command> /?
deeper, such asnetsh advfirewall firewall /?
, which leads to 'netsh advfirewall firewall add /?`, which leads toI'm just adding this for future "generations" - I wish I could divide the answer check with Ken White and admdrew; the first did so much work, I think I will give it to him, although both answers were good. I actually found what I needed though in a comment appended to Hanselmann's post referenced at the top of my question (by Blake, etwa 60% of the way down the page).
I had to enter "cmd" in the Start > Run box, mash Ctrl+Shift+Enter to run the shell as administrator, and then enter these commands:
They ran with no squawking from the Microsoft elves that live inside the console (they meekly echoed back a simple, "Ok." after I pasted them and ran them).
Looks like it's just a syntax thing;
portopening
isn't a valid option foradvfirewall
. Check out:Running
netsh advfirewall firewall add rule /?
from the command line will also give you a bunch of syntax information.