Wednesday, January 31, 2018

Allow asp.net core apps running on IIS express accessible from external computer

By default Asp.net core applications running on IIS Express can only be accessed from localhost, in order to access it from other computer or mobile device, the IIS Express needs to have some custom configuration.

The below steps are for Windows 10 box with Visual Studio 2017:

1. Open IIS express configuration file under the Visual Studio project folder, like
ProjectName\.vs\config\applicationhost.config
(The file will be generated after running the project at least once)

Change the below setting from
   <bindings>
          <binding protocol="http" bindingInformation="*:50532:localhost" />

  </bindings>

To
        <bindings>
          <binding protocol="http" bindingInformation="*:50532:localhost" />
          <binding protocol="http" bindingInformation="*:50532:*" />
        </bindings>


2.Stop and restart Visual Studio in Administrator mode, and run the asp.net core app on IIS Express

I saw few people posted the solution requires firewall disable as well as netsh, but those steps are not needed in my testing. Although I have the McAfee installed on my windows box.

No comments:

Post a Comment