如何手动启动 IIS Express
是否有命令行程序或服务可用于手动启动 IIS Express?
Is there a command line program or service that I can use to start IIS Express manually?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
iisexpress
程序负责此操作。http://www .iis.net/learn/extensions/using-iis-express/running-iis-express-from-the-command-line
iisexpress
program is responsible for that.http://www.iis.net/learn/extensions/using-iis-express/running-iis-express-from-the-command-line
安装 IIS Express 后(最简单的方法是通过 Microsoft Web Platform Installer) ,您将在
%PROGRAMFILES%\IIS Express
(x64 架构上为%PROGRAMFILES(x86)%\IIS Express
)中找到可执行文件,其名为iisexpress.exe
。要查看所有可能的命令行选项,只需运行:
就会显示程序的详细帮助。
如果不带参数执行,则将启动配置文件中定义并标记为在启动时运行的所有站点。系统托盘中的图标将显示哪些站点正在运行。
在配置文件(位于
%USERPROFILE%\Documents\IISExpress\config\applicationhost.config
中)中创建一些站点后,有几个有用的选项:/site 和 <代码>/siteId。
对于第一个,您可以按名称启动特定站点:
对于后者,您可以通过指定 ID 来启动:
使用此选项,如果从命令行启动 IISExpress,则会显示向服务器发出的所有请求的列表将显示,这在调试时非常有用。
最后,可以通过指定完整目录路径来启动站点。 IIS Express 将创建一个虚拟配置文件并启动站点(如果包含空格,请记住引用路径):
这涵盖了命令行中 IISExpress 的基本用法。
Once you have IIS Express installed (the easiest way is through Microsoft Web Platform Installer), you will find the executable file in
%PROGRAMFILES%\IIS Express
(%PROGRAMFILES(x86)%\IIS Express
on x64 architectures) and its callediisexpress.exe
.To see all the possible command-line options, just run:
and the program detailed help will show up.
If executed without parameters, all the sites defined in the configuration file and marked to run at startup will be launched. An icon in the system tray will show which sites are running.
There are a couple of useful options once you have some sites created in the configuration file (found in
%USERPROFILE%\Documents\IISExpress\config\applicationhost.config
): the/site
and/siteId
.With the first one, you can launch a specific site by name:
And with the latter, you can launch by specifying the ID:
With this, if IISExpress is launched from the command-line, a list of all the requests made to the server will be shown, which can be quite useful when debugging.
Finally, a site can be launched by specifying the full directory path. IIS Express will create a virtual configuration file and launch the site (remember to quote the path if it contains spaces):
This covers the basic IISExpress usage from the command line.
从其他人发布的链接中,我没有看到任何选项。 -- 我只是使用 powershell 来终止它 -- 您可以将其保存到 Stop-IisExpress.ps1 文件中:
这没有什么坏处 -- Visual Studio 会在需要时弹出一个新文件。
From the links the others have posted, I'm not seeing an option. -- I just use powershell to kill it -- you can save this to a Stop-IisExpress.ps1 file:
There's no harm in it -- Visual Studio will just pop a new one up when it wants one.
或者,您只需使用 IIS Express 的 Jexus Manager 像完整的 IIS 一样管理它,这是我从事的一个开源项目
https://jexusmanager.com
启动一个站点,该过程将为您启动。
Or you simply manage it like full IIS by using Jexus Manager for IIS Express, an open source project I work on
https://jexusmanager.com
Start a site and the process will be launched for you.
没有程序,但您可以创建一个批处理文件并运行如下命令:
powershell "start-process 'C:\Program Files (x86)\IIS Express\iisexpress.exe' -workingdirectory 'C:\ Program Files (x86)\IIS Express\' -windowstyle 隐藏”
There is not a program but you can make a batch file and run a command like that :
powershell "start-process 'C:\Program Files (x86)\IIS Express\iisexpress.exe' -workingdirectory 'C:\Program Files (x86)\IIS Express\' -windowstyle Hidden"