使用 HTTPS 从命令行使用 /path 启动 IIS Express?
是否可以使用 /path 参数从命令行启动 IIS Express 并包含 HTTPS 绑定?
Is it possible to start IIS Express from the command line using the /path argument and include an HTTPS binding?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
脚本部分的另一部分:
这些命令位于 C:\Program Files (x86)\IIS Express\ 目录中。
Another one for the scripts section:
Those commands are in the
C:\Program Files (x86)\IIS Express\
directory.以下链接将帮助您配置 https 端口(尤其是从此链接阅读“制作 SSL 证书,将其连接到 IIS Express 并使其受信任”)
https://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx
使用 /path 命令行选项时,IIS Express 使用位于 %programfiles%\IIS 中的模板 appliationhost.config 文件Express\AppServer(在 64 位计算机上 %programfiles(x86)%\IIS Express\AppServer)。编辑此配置文件中的绑定元素,如下所示(将协议更改为“https”)
现在从 IIS Express 安装文件夹中运行
iisexpress.exe /path:"” /port:
Following link would help you in configuring https port (especially read "Making an SSL Cert, hooking it up to IIS Express and making it Trusted" from this link )
https://www.hanselman.com/blog/WorkingWithSSLAtDevelopmentTimeIsEasierWithIISExpress.aspx
When /path command line option is used, IIS Express uses the template appliationhost.config file located in %programfiles%\IIS Express\AppServer (on 64-bit machine %programfiles(x86)%\IIS Express\AppServer). Edit binding element in this configuration file as shown below (change the protocol to 'https')
Now from the IIS Express installation folder, run
iisexpress.exe /path:"<path-to-your-web-application>" /port:<HTTPS-port-configured-in-step-1>
我也为此苦苦挣扎。它不完全是您想要的原始解决方案,但您可以通过命令行将新站点添加到默认 iisexpress 配置:
您将希望将 appcmd.exe 定位到 c:\program files (x86)\iisexpress 中
添加后, 然后,您可以使用 iisexpress.exe 以传统方式启动 iisexpress,目标是您刚刚添加到配置中的站点。
通过 ADD、SET 和 DELETE 操作对象
您还需要“允许”iisexpress 提供 ssl 服务。
使用 IISExpress 在开发时使用 SSL 更容易
尽管如此,编写起来可能更容易/更干净您自己的自定义配置文件与您想要的绑定并使用它加载站点。这样可以更好地控制。
I've struggle with this too. Its not quite the pristine solution you want but you can add a new site to the default iisexpress config via the command line:
You'll want to target the appcmd.exe in c:\program files (x86)\iis express
After adding it you can then launch iisexpress the conventional way using iisexpress.exe targeting the site you just added to the config.
Manipulating Objects with ADD, SET, and DELETE
You need to "allow" iisexpress to serve ssl as well.
Working with SSL at Development Time is easier with IISExpress
Still it's probably just easier/cleaner to write your own custom config file with the bindings you want and load the site using that. More control that way.