简体   繁体   English

更快地附加到VS中的工作进程的方法

[英]Quicker way to attach to the worker process in VS

I'm using VS 2010. And in VS 2010 it's even more painful now to attach to the worker process when you want to test your local IIS site via IIS, not the VS built-in web server. 我正在使用VS 2010.而在VS 2010中,当您想要通过IIS而不是VS内置Web服务器测试本地IIS站点时,附加到工作进程会更加痛苦。

It's more painful because now when you select the worker process () via the Debug Menu | 现在当您通过Debug Menu |选择worker process()时,会更加痛苦 Attach to Process | 附加到流程| w3wp.exe it brings up an additional prompt asking if you're sure you want to do this. w3wp.exe会显示一个额外的提示,询问您是否确定要执行此操作。

Even before this, attaching to the process in previous versions of VS was just outright painful. 即使在此之前,在VS的早期版本中附加到该过程也是非常痛苦的。 I must do this 200 times a day which wastes a lot of my time when it takes 5-10 seconds to click through and do this. 我必须每天做200次这样做浪费了我很多时间,这需要5-10秒才能点击并执行此操作。

Now if you've got 2 different worker processes going, then I can see a need to choose. 现在,如果您有两个不同的工作流程,那么我可以看到需要选择。 But before that, just getting to that attach screen is simply painful. 但在此之前,只需进入连接屏幕就很痛苦。

Anyone know a shortcut or just a quicker way other than the attach to process dialog in order to attach to the worker process in VS? 除了附加到进程对话框以便附加到VS中的工作进程之外,任何人都知道快捷方式或只是更快捷的方法吗?

I don't understand why Microsoft doesn't add a nice toolbar icon or something that jumps you right to that Attach to Dialog screen and even better you could be able to specify only to show worker processes as an option which would save me a hell of a log of time sifting through that list even though it's already alphabetized. 我不明白为什么微软不会添加一个漂亮的工具栏图标或者你跳到右边的那个附加到对话框的屏幕,甚至更好的你可以指定只显示工作进程作为一个选项,这将节省我一个地狱即使它已经按字母顺序排列,也可以查看该列表中的时间日志。 I still have to scroll to get to it. 我仍然需要滚动才能达到目的。

Anyway, it's becoming a huge annoyance now..I'm really tired of the long way to get the attachment going to that process every single time. 无论如何,它现在变成了一个巨大的烦恼......我真的厌倦了每一次让附件进入该过程的漫长道路。

Hm, not a great leap over and above what you are doing, but it may ease your workflow. 嗯,不是一个超越你正在做的伟大的飞跃,但它可以减轻你的工作流程。 have you taken a look at command customization? 你看看命令定制了吗?

  1. Click Tools -> Customize ... (or Right-click tool bar and select Customize ...) 单击工具 - >自定义...(或右键单击工具栏并选择自定义...)
  2. From Customize dialog, click Commands 从“自定义”对话框中,单击“命令”
  3. Select your target, (I suggest Context menu) 选择你的目标,(我建议上下文菜单)
  4. Select your sub target (if Context menu, select Editor Context Menus | Code Window) 选择子目标(如果是上下文菜单,请选择编辑器上下文菜单|代码窗口)
  5. Click Add Command 单击添加命令
  6. From Add Command dialog, select Debug category 从Add Command对话框中,选择Debug category
  7. Select Attach to Process... from command list (near top) 从命令列表中选择Attach to Process ...(靠近顶部)
  8. Click OK 单击确定
  9. Click Close 单击关闭
  10. Use your new shortcut! 使用新的快捷方式!

Hope this helps! 希望这可以帮助! :) :)

ps: if you added Attach to Process... command to Code Window context menu, you should be able to launch the Attach to Process dialog from right clicking anywhere in a code window. ps:如果您将“附加到进程...”命令添加到“代码窗口”上下文菜单,则应该可以通过右键单击代码窗口中的任意位置来启动“附加到进程”对话框。

Record a macro while attaching and assign a shortcut for that macro and/or assign a menu item for it. 在附加时录制 ,并为该指定快捷方式和/或为其指定菜单项。 Steps: 脚步:

  1. Tools -> Macros ->Record Temporary macro 工具 - >宏 - >记录临时宏
  2. Attach to w3wp, Click on Ignore, etc 附加到w3wp,单击忽略等
  3. Stop recording the macro 停止录制宏
  4. Save it 保存
  5. To add a menu item (say under Debug) Right click on VS's Menu strip -> Customize... ->Commands -> ... Add Command -> Macros.YourMacroNAme(DebugIIS for eg) 添加一个菜单项(比如Debug下)右键单击VS的菜单条 - >自定义... - >命令 - > ...添加命令 - >宏.YourMacroNAme(例如DebugIIS)

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

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