Asp. Net configure IISExpress to allow external access,

Source: Internet
Author: User

Asp. Net configure IISExpress to allow external access,

1. Find the IISExpress configuration file, or in the (document/IISExpress/config) folder, open applicationhost. config, and find the following code:
<Site name = "WebSite1" id = "1" serverAutoStart = "true">
<Application path = "/">
<VirtualDirectory path = "/" physicalPath = "% IIS_SITES_HOME % \ WebSite1"/>
</Application>
<Bindings>
<Binding protocol = "http" bindingInformation = ": 8080: localhost"/>
<Binding protocol = "http" bindingInformation = "*: 8080: 192.168.1.1"/>
</Bindings>
</Site>

The name is the name of your Web project, find the configuration corresponding to your project, and then
<Binding protocol = "http" bindingInformation = "*: 8080: localhost"/>
Add
<Binding protocol = "http" bindingInformation = "*: 8080: 192.168.1.1"/>
Replace 192.168.1.1 with your own IP address and 8080 with your own port.

 

2. After you press the above button, the 400 error may occur when you access through the IP address. If yes, use the following method:
(1) Open the CMD command window as an administrator
(2) enter the following command:
Netsh http add urlacl url = http: // 192.168.1.1: 8080/user = everyone
Similarly, change the IP address and port to your own. If an error is reported, check whether the command is run as an administrator. Restart IISExpress and you can use the IP address to access it.


3. After completing the above two parts, other computers may not be able to access your server due to firewall reasons. In this case, use the following method (here the system is win8.1)
(1) control panel (select a category for viewing)-> system and security-> Windows Firewall, select Advanced Settings on the left
(2) Right-click inbound rules-> create rules-> port-> enter 8080 at a specific local port-> allow connection-> select all three options-> enter the new rule name-> complete
Now the external program can access your IISExpress.

 

Reprinted: http://blog.csdn.net/zhangjk1993/article/details/36671105

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.