由于VS在开发WEB应用程序时,每次都需要重新启动IIS Express,速度太慢了,如果改为手动控制IIS Express启动,那么可以直接编译应用程序后,直接刷新页面,那么速度会更快。
因此需要常用的两个命令为:
appcmd list site:列出IIS Express中包含的所有网站;
运行结果为:
C:UsersRising 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所在的文件夹路径添加到系统的路径参数中。