.NET 개발/ASP.NET Web API

IIS Express 에 외부 IP 로 접근하기

Hoya0415 2016. 8. 24. 11:28


1. 내 문서 경로\IISExpress\config\applicationhost.config 을 편집으로 파일을 연다.


2. 단어 검색으로 <sites>부분을 검색하고


  <site name="프로젝트이름" id="3">

                <application path="/" applicationPool="Clr4IntegratedAppPool">

                    <virtualDirectory path="/" physicalPath="H:\프로젝트이름" />

                </application>

                <bindings>

                    <!--<binding protocol="http" bindingInformation="*:58665:localhost" />-->

                     <binding protocol="http" bindingInformation="*:58665:" /> 

                </bindings>

  </site>


Visual Studio  생성한 웹 사이트 주소를가 Site 태그에 있을 것이다.


물리적주소 physicalPath도 보인다


그리고 <binding 태그를 보면 원래는 bindingInformation 이 부분이 아래와 같은데 


 <!--<binding protocol="http" bindingInformation="*:58665:localhost" />-->


바꿔주면 된다.


<binding protocol="http" bindingInformation="*:58665:" /> 


바꾼 후 관리자 모드로 Visual Studio를 켜고 프로젝트를 불러와서 실행해보면 


외부 IP로도 접근이 가능하다.


※추가※

만약 위에 사항해도 안된다면 

방화벽은 해제와 고급 보안이 포함된 윈도우 방화벽에서 인바운드 포트를 열어주면 된다.