LoginSignup
0
0

More than 3 years have passed since last update.

【編集中】IISExpress実行時ERR_CONNECTION_REFUSEDで起動しない...

Last updated at Posted at 2019-08-26

TODO

  • 解決策書けてない。

※完全な解決策はないにしろ、予防策はあるはず...
 ポートが利用されているかどうかを確認するコマンド(netstat)
 大量にポートを利用するアプリケーションがないか!?

はじめに

ポート番号を変更すれば動作するんですが、問題発生する度に毎回対応するのは大変…特に忙しい時に発生したときなんて(ToT)

参考サイト

◆IISExpressを実行しているlocalhostに接続しようとしたときのERR_CONNECTION_REFUSEDを解決する方法 - エラー502(Visual Studioからデバッグできません)
 https://www.it-swarm.net/ja/visual-studio/iisexpressを実行しているlocalhostに接続しようとしたときのerrconnectionrefusedを解決する方法-エラー502%EF%BC%88visual-studioからデバッグできません%EF%BC%89/1055912141/
 ※問題の概要はこのサイトとほぼ同じ

◆インターネット インフォメーション サービス MMC スナップインで Web サイトを起動しようとするとき、「プロセスはファイルにアクセスできません」エラー メッセージが表示されます。
 https://support.microsoft.com/ja-jp/help/890015/you-receive-a-the-process-cannot-access-the-file-because-it-is-being-u
 ※イベントビューアにも下記エラーで出力される...
  イベント ソース: HTTP
  イベント ID: 15005

◆IPアドレスへのIISExpressのバインドが失敗する
 https://codeday.me/jp/qa/20190410/597752.html
  ※①現状どうなっているか確認!!

◆Solved - IIS Express failed to register URL - Access is denied
 https://programmingflow.com/2015/08/28/solved-iis-express-failed-to-register-url-access-is-denied.html
 ※②Solutionを試してみる。。。

◆IISのapplicationhost.configのファイルのパス、保存場所はどこ?
 https://urashita.com/archives/27177
  
◆IIS Express のサイト設定から存在しないものを一括で削除する
 https://blog.shibayan.jp/entry/20150615/1434375654
  ※これが原因っぽい…当たりならここにあるスクリプトを使いたい③
 

解決に向け試してみる...

try.bat
REM ①
netsh http show iplisten

REM ②
netsh http add iplisten ipaddress=::

REM ③ ※powershell
$appcmd = "C:\Program Files\IIS Express\appcmd.exe"
[xml]$result = Invoke-Command -Command {& $appcmd 'list' 'vdir' '/xml' }
for ($i = 0; $i -lt $result.appcmd.VDIR.Length; $i++)
{
    if (!(Test-Path $result.appcmd.VDIR[$i].physicalPath))
    {
        $sitename = $result.appcmd.VDIR[$i]."APP.NAME".TrimEnd('/')
        Invoke-Command -Command {& $appcmd 'delete' 'site' $sitename }
    }
}

結果

Coming Soon...

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0