如何手动启动 IIS Express

发布于 2024-10-22 04:06:01 字数 38 浏览 2 评论 0原文

是否有命令行程序或服务可用于手动启动 IIS Express?

Is there a command line program or service that I can use to start IIS Express manually?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

云淡月浅 2024-10-29 04:06:01

安装 IIS Express 后(最简单的方法是通过 Microsoft Web Platform Installer) ,您将在%PROGRAMFILES%\IIS Express(x64 架构上为%PROGRAMFILES(x86)%\IIS Express)中找到可执行文件,其名为 iisexpress.exe

要查看所有可能的命令行选项,只需运行:

iisexpress /?

就会显示程序的详细帮助。

如果不带参数执行,则将启动配置文件中定义并标记为在启动时运行的所有站点。系统托盘中的图标将显示哪些站点正在运行。

在配置文件(位于 %USERPROFILE%\Documents\IISExpress\config\applicationhost.config 中)中创建一些站点后,有几个有用的选项:/site 和 <代码>/siteId。

对于第一个,您可以按名称启动特定站点:

iisexpress /site:SiteName

对于后者,您可以通过指定 ID 来启动:

iisexpress /siteId:SiteId

使用此选项,如果从命令行启动 IISExpress,则会显示向服务器发出的所有请求的列表将显示,这在调试时非常有用。

最后,可以通过指定完整目录路径来启动站点。 IIS Express 将创建一个虚拟配置文件并启动站点(如果包含空格,请记住引用路径):

iisexpress /path:FullSitePath

这涵盖了命令行中 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 called iisexpress.exe.

To see all the possible command-line options, just run:

iisexpress /?

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:

iisexpress /site:SiteName

And with the latter, you can launch by specifying the ID:

iisexpress /siteId:SiteId

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):

iisexpress /path:FullSitePath

This covers the basic IISExpress usage from the command line.

毁虫ゝ 2024-10-29 04:06:01

从其他人发布的链接中,我没有看到任何选项。 -- 我只是使用 powershell 来终止它 -- 您可以将其保存到 Stop-IisExpress.ps1 文件中:

get-process | where { $_.ProcessName -like "IISExpress" } | stop-process

这没有什么坏处 -- 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:

get-process | where { $_.ProcessName -like "IISExpress" } | stop-process

There's no harm in it -- Visual Studio will just pop a new one up when it wants one.

新一帅帅 2024-10-29 04:06:01

或者,您只需使用 IIS Express 的 Jexus Manager 像完整的 IIS 一样管理它,这是我从事的一个开源项目

https://jexusmanager.com

Jexus Manager for IIS Express

启动一个站点,该过程将为您启动。

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

Jexus Manager for IIS Express

Start a site and the process will be launched for you.

你对谁都笑 2024-10-29 04:06:01

没有程序,但您可以创建一个批处理文件并运行如下命令:

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"

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文