简体   繁体   English

启动IISExpress时如何摆脱命令行window?

[英]How to get rid of command line window when starting IISExpress?

Is there a chance to get rid of command line window when starting IISExpress (iisexpress.exe)?启动 IISExpress (iisexpress.exe) 时是否有机会摆脱命令行 window? In the thread Use IIS Express in visual studio 2010 without sp1 and command window is determined, that it is not possible with a parameter of iisexpress.exe itself.在线程Use IIS Express in Visual Studio 2010 without sp1 和命令 window确定,这是不可能的 iisexpress.exe 本身的参数。

Are there any tricks with batch scripting or something like that?批处理脚本或类似的东西有什么技巧吗?

I want to start IISExpress with a.bat file, but then the command windows should hide itself (because stopping the server is also possible with the tray icon).我想用 .bat 文件启动 IISExpress,但是命令 windows 应该隐藏自己(因为也可以使用托盘图标停止服务器)。

Using PowerShell:使用 PowerShell:

Start-Process .\iisexpress.exe -WindowStyle Hidden

Meanwhile I found a few ways to solve this.同时我找到了一些解决这个问题的方法。 One way is a Windows Script, see Duncan Smart's Weblob or directly his GIT-Repository .一种方法是 Windows 脚本,请参阅Duncan Smart 的 Weblob或直接查看他的GIT-Repository

Another way is to build a Windows Form Application (or similar), and use the ProcessStartInfo class , which offers the ProcessWindowStyle.Hidden property.另一种方法是构建 Windows 表单应用程序(或类似应用程序),并使用提供ProcessWindowStyle.Hidden属性的ProcessStartInfo class

What I did at last: I dropped IIS Express and switched to CassiniDev .我最后做了什么:我放弃了 IIS Express 并切换到CassiniDev It is a great webserver (amongst others available as console application and DLL-assembly) which allowed me to build be "self-hosted" website by importing a single DLL.它是一个很棒的网络服务器(其中包括控制台应用程序和 DLL 程序集),它允许我通过导入单个 DLL 来构建“自托管”网站。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM