IIS Express 10 (Visual Studio 2015) でリモート(localhost以外、他のホスト)からアクセスしたい

applicationhost.config の修正

IIS Expressの設定ファイル"applicationhost.config"を変更します。
google先生に尋ねると、 C:\Users\ユーザ名\Documents\IISExpress\config\applicationhost.config だと言うんだけど、中身を見ると違う。ローカルを調べまくってみると、下記にあることが分かった。

C:\Users\ユーザ名\Source\Repos\SkillDB\.vs\config\applicationhost.config


念のため、対象プロジェクトかどうかを physicalPath で検索して確認。
siteセクション内のさらにbindingsセクションの中にbindingタグを追加します。
修正前

<site name="(プロジェクト名)" id="2">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="(プロジェクトファイルのあるパス)" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation="*:3189:localhost" />
    </bindings>
</site>

修正後

<site name="(プロジェクト名)" id="2">
    <application path="/" applicationPool="Clr4IntegratedAppPool">
        <virtualDirectory path="/" physicalPath="(プロジェクトファイルのあるパス)" />
    </application>
    <bindings>
        <binding protocol="http" bindingInformation="*:3189:localhost" />
        <binding protocol="http" bindingInformation="*:3189:(このホスト/マシンのIPアドレス)" />
    </bindings>
</site>

ACL(Access Control List)の設定

管理者権限でコマンドプロンプトを開き、下記のコマンドを実行して下さい。

netsh http add urlacl url=http://IPアドレスorホスト名:ポート番号/ user=everyone

デバッグとか終わって削除する場合は、下記のコマンドを実行して下さい。

netsh http delete urlacl url=http://IPアドレスorホスト名:ポート番号/

Windows ファイアウォール でポートに穴を空ける

空けます。

これで繋がりますよ。