visual studio - Why aren't my networked computers able to access localhost from VS2017? -
coming xampp, using apache server, used test websites in networked computer typing ipaddress
:portnumber
on address bar of desired networked computer.
then while developing vs2017, found out not possible default. while works fine in localhost, networked computer unable access website. need access change settings can expose port 8012 rather 127.0.0.1:8012 ?
i assume that's problem here.
i able solve problem changing binding values in
applicationhost.config
- vs2015 onwards, can found inside individual project folder
%projectfolder%/.vs/config/
- in pre-2015 vs, available in
%user%/documents/iisexpress/config/
if familar xampp, setting similar %xampp%/apache/conf/httpd.conf
- the difference that, instead of setting listen port number, have bind port in iisexpress
- by default, port bound localhost host computer. say, port 3940 bound
*:3940:locahost
, makes available computer running vs. - to make available networked computers, need change section follows:
change this:
<bindings> <binding protocol="http" bindinginformation="*:3940:localhost" /> </bindings>
to:
<bindings> <binding protocol="http" bindinginformation="*:3940:*" /> </bindings>
- note: in cases,
bindinginformation="*:3940:"
may used instead ofbindinginformation="*:3940:*"
if after this, still not work, may firewall issue @mukesh pointed out in comment.
- firewall issues can found out pinging target device.
- if ping successful port not allowed, open firewall in advanced mode
- open run (windows + r)
- type firewall.cpl
- click on advanced settings
- click on inbound rules
- create new rule
- add desired port rule
- port > specific local ports:
3940
> allow connection > check (domain, private, public) > give name rule:examplerule
> finish- you can replace
3940
desired port number or port range. possible select possible ports.- optional: although nothing needs done in client computer, may need configure firewall inbound rule accept inbound connections
- if not firewall issue, can else entirely. maybe you're getting 400 error page, or 503 error. following questions helped me lot tackle problems (although had revert acl allowance later). hope useful in future
- iis express configuration
- change binding, acl , port forwarding
- http 400 bad request error
- solution ^ here
- 503 service unavailable error
- sometimes solved creating binding entries in
applicationhost.config
- other times, duplicate-binding problem. , need remove binding entry during times. if editing
applicationhost.config
inside project folder, okay keep 1 site , binding information.- for particular case, had revert operation
netsh http add urlacl url=http://192.168.10.3:3940/ user=everyone
netsh http delete urlacl url=http://192.168.10.3:3940/
because kept getting 502 bad gateway error when tried tunneling.- things remember:
- please remember restart iisexpress after each change. vs itself. double check running instances.
- also, run vs in administrative mode. clears many problems , allows sub-processes, such iisexpress startup in elevated privilege mode avoid permission errors.
Comments
Post a Comment