如何为 IIS Express 进程添加标签(设置标题)?
我有一个包含多个网站的解决方案,并且我一直在使用 Cassini 进行开发。当 IIS Express 出现时,我将其中一个网站转移到使用它,一切都运行良好。我刚刚移动另一个网站以使用 IIS Express,并立即遇到了调试问题:IIS Express 没有标记其进程,所以现在我有两个正在运行,我无法在“附加到进程”中区分它们对话。
有没有办法让 IIS Express 设置进程标题?有人有任何关于区分多个 IIS Express 实例以附加调试器的提示吗?
更新 执行此操作的一种迂回方法是执行 IIS Express 托盘图标的“显示所有应用程序”上下文菜单,并在附加调试器时引用列表中的 PID。总比没有好,但如果有更好的方法那就太好了。
更新2 我添加了一个连接问题: https://connect.microsoft.com/VisualStudio/feedback/details/729475/impossible-to- Differentiate-iis-express-instances-when-attaching-debugger
I have a solution with multiple websites and I have been using Cassini for development. When IIS Express came out, I transitioned one of the websites to use it, and everything has been running fine. I just moved another website to use IIS Express and immediately ran into a problem with debugging: IIS Express does not label its processes, so now that I have two of them running, I can't tell them apart in the "Attach to process" dialog.
Is there a way to have IIS Express set the process title? Anyone have any tips for telling multiple IIS Express instances apart for the purposes of attaching the debugger?
Update
A round-about way of doing this is to execute "Show all applications" context menu of the IIS Express tray icon and reference the PID from the list when attaching the debugger. Better than nothing, but would be nice if there was a better way.
Update 2
I added a connect issue: https://connect.microsoft.com/VisualStudio/feedback/details/729475/impossible-to-differentiate-iis-express-instances-when-attaching-debugger
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
或者,您可以添加此代码以从页面内部启动调试器。它快速且简单,您只需使用隐藏的本地页面即可调用它并启动调试器。
Alternatively, you can add this code to start the debugger from inside your page. It's fast and easy, and you can just use a hidden local page to call it and start your debugger.
我从批处理文件运行 IISExpress 实例。然后,cmd 文件的名称将在附加到进程中显示为进程名称。
例如:将其放在 MySite.cmd 文件中
"C:\Program Files (x86)\IIS Express\iisexpress.exe" /siteid:1
将在“附加到进程”中的“标题”列中显示为
我的网站
I run the IISExpress instances from a batch file. The name of the cmd file then shows up as the process name in Attach to Process.
eg: have this in the MySite.cmd file
"C:\Program Files (x86)\IIS Express\iisexpress.exe" /siteid:1
Would show up in the Title colum in Attach to Process as
MySite
不要忘记对 System.Management 的引用...
Don't forget a reference to System.Management ...
我同意需要为“附加到进程”对话框标记进程。但是,有一个针对您的具体情况的解决方法。
解决方法:
如果同一解决方案中有两个项目,您可以选择多个启动项目:
https://learn.microsoft.com/en-us/visualstudio/ide/how-to-set-multiple-startup-projects?view=vs-2015
I agree with the need to label the processes for the "attach to process" dialog. However, there's a workaround for your specific case.
Workaround:
If you have two projects in the same solution you can choose multiple startup projects:
https://learn.microsoft.com/en-us/visualstudio/ide/how-to-set-multiple-startup-projects?view=vs-2015