手動控制IIS Express的兩個常用方法


由於VS在開發WEB應用程序時,每次都需要重新啟動IIS Express,速度太慢了,如果改為手動控制IIS Express啟動,那么可以直接編譯應用程序后,直接刷新頁面,那么速度會更快。

因此需要常用的兩個命令為:

appcmd list site:列出IIS Express中包含的所有網站;

運行結果為:

C:\Users\Rising X>appcmd list site
SITE "WebSite1" (id:1,bindings:http/:8080:localhost,state:Unknown)
SITE "MVC5Demo" (id:2,bindings:http/*:12834:localhost,state:Unknown)
SITE "UserLimitMVC.UI.Portal" (id:3,bindings:http/*:15118:localhost,state:Unknow
n)
SITE "Admin" (id:4,bindings:http/*:28628:localhost,state:Unknown)
SITE "App.Admin" (id:5,bindings:http/*:1332:localhost,state:Unknown)
SITE "Company.Project1.Server.Host" (id:6,bindings:http/*:5000:localhost,state:U
nknown)
SITE "NtEfApp.Server.Host" (id:7,bindings:http/*:2452:localhost,state:Unknown)
SITE "AccountAtAGlance" (id:8,bindings:http/*:22764:localhost,state:Unknown)
SITE "langsinERP" (id:9,bindings:http/*:13253:localhost,state:Unknown)
SITE "AngularDemo" (id:10,bindings:http/*:20555:localhost,state:Unknown)
SITE "WebAPIDemo1" (id:11,bindings:http/*:21023:localhost,state:Unknown)
SITE "WebAPI" (id:12,bindings:http/*:4115:localhost,state:Unknown)
SITE "WebApplication1" (id:13,bindings:http/*:25974:localhost,state:Unknown)
SITE "RightMng" (id:14,bindings:http/*:27057:localhost,state:Unknown)

其中id:序號,對應的為應用程序的序號。

2.IISExpress  /siteid:序號    ,此命令啟動指定序號的應用程序,那么此應用程序則將一直在運行。

為了能使命令行窗口中可以直接使用此兩命令,需要把IIS Express所在的文件夾路徑添加到系統的路徑參數中。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM