IIS ExpressでのWebアプリケーションのデバッグ

iis7 Visual StudioでのIIS Expressの公式サポートを待ちたくない人のために、デバッグオプションを自分で簡単に強化する方法があります。



必要なのは、IIS Expressを含むWebMatrixベータ版をダウンロードすることです(個別のダウンロードはまだありません)。







IIS Expressを置きます



WebMatrixをインストールした後、「My Documents \ IISExpress8 \ config \ applicationhost.config」ファイルを見つけて編集します。

145行目に移動して、WebSite1の画像と肖像に別のサイト定義を作成し、serverAutoStart属性を削除します。

Copy Source | Copy HTML < site name ="WebSite1" id ="1"> < application path ="/"> < virtualDirectory path ="/" physicalPath ="%IIS_SITES_HOME%\WebSite1" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8080:localhost" /> </ bindings > </ site > < site name ="VSDebug" id ="2"> < application path ="/" applicationPool ="Clr4IntegratedAppPool"> < virtualDirectory path ="/" physicalPath ="c:\dev\mysite" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8421:localhost" /> </ bindings > </ site >



  1. Copy Source | Copy HTML < site name ="WebSite1" id ="1"> < application path ="/"> < virtualDirectory path ="/" physicalPath ="%IIS_SITES_HOME%\WebSite1" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8080:localhost" /> </ bindings > </ site > < site name ="VSDebug" id ="2"> < application path ="/" applicationPool ="Clr4IntegratedAppPool"> < virtualDirectory path ="/" physicalPath ="c:\dev\mysite" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8421:localhost" /> </ bindings > </ site >



  2. Copy Source | Copy HTML < site name ="WebSite1" id ="1"> < application path ="/"> < virtualDirectory path ="/" physicalPath ="%IIS_SITES_HOME%\WebSite1" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8080:localhost" /> </ bindings > </ site > < site name ="VSDebug" id ="2"> < application path ="/" applicationPool ="Clr4IntegratedAppPool"> < virtualDirectory path ="/" physicalPath ="c:\dev\mysite" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8421:localhost" /> </ bindings > </ site >



  3. Copy Source | Copy HTML < site name ="WebSite1" id ="1"> < application path ="/"> < virtualDirectory path ="/" physicalPath ="%IIS_SITES_HOME%\WebSite1" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8080:localhost" /> </ bindings > </ site > < site name ="VSDebug" id ="2"> < application path ="/" applicationPool ="Clr4IntegratedAppPool"> < virtualDirectory path ="/" physicalPath ="c:\dev\mysite" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8421:localhost" /> </ bindings > </ site >



  4. Copy Source | Copy HTML < site name ="WebSite1" id ="1"> < application path ="/"> < virtualDirectory path ="/" physicalPath ="%IIS_SITES_HOME%\WebSite1" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8080:localhost" /> </ bindings > </ site > < site name ="VSDebug" id ="2"> < application path ="/" applicationPool ="Clr4IntegratedAppPool"> < virtualDirectory path ="/" physicalPath ="c:\dev\mysite" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8421:localhost" /> </ bindings > </ site >



  5. Copy Source | Copy HTML < site name ="WebSite1" id ="1"> < application path ="/"> < virtualDirectory path ="/" physicalPath ="%IIS_SITES_HOME%\WebSite1" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8080:localhost" /> </ bindings > </ site > < site name ="VSDebug" id ="2"> < application path ="/" applicationPool ="Clr4IntegratedAppPool"> < virtualDirectory path ="/" physicalPath ="c:\dev\mysite" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8421:localhost" /> </ bindings > </ site >



  6. Copy Source | Copy HTML < site name ="WebSite1" id ="1"> < application path ="/"> < virtualDirectory path ="/" physicalPath ="%IIS_SITES_HOME%\WebSite1" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8080:localhost" /> </ bindings > </ site > < site name ="VSDebug" id ="2"> < application path ="/" applicationPool ="Clr4IntegratedAppPool"> < virtualDirectory path ="/" physicalPath ="c:\dev\mysite" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8421:localhost" /> </ bindings > </ site >



  7. Copy Source | Copy HTML < site name ="WebSite1" id ="1"> < application path ="/"> < virtualDirectory path ="/" physicalPath ="%IIS_SITES_HOME%\WebSite1" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8080:localhost" /> </ bindings > </ site > < site name ="VSDebug" id ="2"> < application path ="/" applicationPool ="Clr4IntegratedAppPool"> < virtualDirectory path ="/" physicalPath ="c:\dev\mysite" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8421:localhost" /> </ bindings > </ site >



  8. Copy Source | Copy HTML < site name ="WebSite1" id ="1"> < application path ="/"> < virtualDirectory path ="/" physicalPath ="%IIS_SITES_HOME%\WebSite1" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8080:localhost" /> </ bindings > </ site > < site name ="VSDebug" id ="2"> < application path ="/" applicationPool ="Clr4IntegratedAppPool"> < virtualDirectory path ="/" physicalPath ="c:\dev\mysite" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8421:localhost" /> </ bindings > </ site >



  9. Copy Source | Copy HTML < site name ="WebSite1" id ="1"> < application path ="/"> < virtualDirectory path ="/" physicalPath ="%IIS_SITES_HOME%\WebSite1" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8080:localhost" /> </ bindings > </ site > < site name ="VSDebug" id ="2"> < application path ="/" applicationPool ="Clr4IntegratedAppPool"> < virtualDirectory path ="/" physicalPath ="c:\dev\mysite" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8421:localhost" /> </ bindings > </ site >



  10. Copy Source | Copy HTML < site name ="WebSite1" id ="1"> < application path ="/"> < virtualDirectory path ="/" physicalPath ="%IIS_SITES_HOME%\WebSite1" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8080:localhost" /> </ bindings > </ site > < site name ="VSDebug" id ="2"> < application path ="/" applicationPool ="Clr4IntegratedAppPool"> < virtualDirectory path ="/" physicalPath ="c:\dev\mysite" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8421:localhost" /> </ bindings > </ site >



  11. Copy Source | Copy HTML < site name ="WebSite1" id ="1"> < application path ="/"> < virtualDirectory path ="/" physicalPath ="%IIS_SITES_HOME%\WebSite1" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8080:localhost" /> </ bindings > </ site > < site name ="VSDebug" id ="2"> < application path ="/" applicationPool ="Clr4IntegratedAppPool"> < virtualDirectory path ="/" physicalPath ="c:\dev\mysite" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8421:localhost" /> </ bindings > </ site >



  12. Copy Source | Copy HTML < site name ="WebSite1" id ="1"> < application path ="/"> < virtualDirectory path ="/" physicalPath ="%IIS_SITES_HOME%\WebSite1" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8080:localhost" /> </ bindings > </ site > < site name ="VSDebug" id ="2"> < application path ="/" applicationPool ="Clr4IntegratedAppPool"> < virtualDirectory path ="/" physicalPath ="c:\dev\mysite" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8421:localhost" /> </ bindings > </ site >



  13. Copy Source | Copy HTML < site name ="WebSite1" id ="1"> < application path ="/"> < virtualDirectory path ="/" physicalPath ="%IIS_SITES_HOME%\WebSite1" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8080:localhost" /> </ bindings > </ site > < site name ="VSDebug" id ="2"> < application path ="/" applicationPool ="Clr4IntegratedAppPool"> < virtualDirectory path ="/" physicalPath ="c:\dev\mysite" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8421:localhost" /> </ bindings > </ site >



  14. Copy Source | Copy HTML < site name ="WebSite1" id ="1"> < application path ="/"> < virtualDirectory path ="/" physicalPath ="%IIS_SITES_HOME%\WebSite1" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8080:localhost" /> </ bindings > </ site > < site name ="VSDebug" id ="2"> < application path ="/" applicationPool ="Clr4IntegratedAppPool"> < virtualDirectory path ="/" physicalPath ="c:\dev\mysite" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8421:localhost" /> </ bindings > </ site >



  15. Copy Source | Copy HTML < site name ="WebSite1" id ="1"> < application path ="/"> < virtualDirectory path ="/" physicalPath ="%IIS_SITES_HOME%\WebSite1" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8080:localhost" /> </ bindings > </ site > < site name ="VSDebug" id ="2"> < application path ="/" applicationPool ="Clr4IntegratedAppPool"> < virtualDirectory path ="/" physicalPath ="c:\dev\mysite" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8421:localhost" /> </ bindings > </ site >



  16. Copy Source | Copy HTML < site name ="WebSite1" id ="1"> < application path ="/"> < virtualDirectory path ="/" physicalPath ="%IIS_SITES_HOME%\WebSite1" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8080:localhost" /> </ bindings > </ site > < site name ="VSDebug" id ="2"> < application path ="/" applicationPool ="Clr4IntegratedAppPool"> < virtualDirectory path ="/" physicalPath ="c:\dev\mysite" /> </ application > < bindings > < binding protocol ="http" bindingInformation =":8421:localhost" /> </ bindings > </ site >





変更された属性の値は明らかだと思うので、説明をスキップします。

サーバーを起動します。 これを行うには、次のコマンドを使用します。



"C:\Program Files (x86)\Microsoft WebMatrix\iisexpress.exe" /site:{YOUR_SITE_NAME}







{YOUR_SITE_NAME}の代わりに、applicationhost.configで指定したサイトの名前に置き換える必要があります。 私の場合、これはVSDebugです。 すべてが正しく完了すると、サーバーが起動し、サイトが利用可能になります。



Visual Studioをカスタマイズする



スタジオを立ち上げ、ウェブサイトをアップロードします。 プロジェクトを右クリックし、[プロパティ]を選択して[Web]タブに移動します。 ここで、外部プログラムの起動を選択し、サーバーを起動するコマンドを指定する必要があります。







以下の同じウィンドウで、[カスタムWebサーバーを使用]を選択し、サイトのURLを再度入力します。







[デバッガ]セクションで、すべてのボックスをオフにします。 スタジオはIISにアタッチしようとし、デバッグを許可しません。







ここでプロパティを保存し、F5キーを押してデバッグを開始します。 IIS Expressトレイアイコンを使用して、ブラウザでサイトを開くことができます。







PS次のKamran Ayubの記事は、このプロセスを説明するきっかけになりました。 ただし、ここで説明する方法はやや単純で、サーバーを手動で再起動して接続する必要がなくなると思います。




All Articles