自动连接到开发服务器的 Visual Studio 插件
有人知道 Visual Studio 2010 插件可以自动连接到 ASP.Net 开发服务器的运行实例吗?如果当前正在运行多个 ASP.Net 开发服务器,则显示一个快速对话框,让您从仅正在运行的 ASP.Net 开发服务器列表中进行选择?
我为什么要这个? <-- 随意跳过这一部分。
我通常开发/调试 Web 应用程序的方式是启动浏览器并浏览应用程序,直到到达我想要的页面(可能是很多页面)深。)出于各种原因,我不想通过这些步骤附加调试器(它比不附加它要慢,可能会遇到无关的断点,当“抛出”打开时我可能会中断并且不希望当处理的错误发生时,在应用程序中提前中断抛出等...)
我导航到我想要的页面,然后使用 Visual Studio 菜单“调试”>附加到进程,然后在“附加到进程”对话框中,我必须一直向下滚动(进程的页面和页面),直到找到我想要的 WebDev.WebServer40.EXE 进程并选择它。
这样做会让我的手离开键盘并使用鼠标(我通常会尽量避免这样做。)
并且这样做似乎是不必要的重复,因为如果我正在调试 ASP.Net Web 应用程序,我总是想附加到一个实例WebDev.WebServer40.exe 的。
Is anyone aware of a Visual Studio 2010 Add-In that will automatically allow you to attach to a running instance of the ASP.Net Development Server? And if there is more than one currently running, display a quick dialog that lets you choose from a list of just the ASP.Net Development Servers that are running?
Why do I want this? <-- feel free to skip this part.
The way I usually develop / debug web applications is to launch a browser and navigate through the application until I get to the page I want (could be many pages deep.) I don't want to have the debugger attached through these steps for various reasons (it is slower than not having it attached, extraneous break-points may be hit, I may have break when "thrown" turned on and not want to break earlier in the app when handled errors are thrown, etc...)
I navigate to the page I want, then use the Visual Studio menus to Debug > Attach to Process, and then from within the Attach to Process dialog, I have to scroll all the way down (pages and pages and pages of processes) until I find the WebDev.WebServer40.EXE process I want and choose that.
Doing this makes me take my hands off the keyboard and use a mouse (something I generally try to avoid.)
And doing this seems needlessly repetitive since, if I am debugging an ASP.Net Web Application, I always want to attach to an instance of the WebDev.WebServer40.exe.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我更喜欢做完全相同的事情,并且可以可以使用宏将其全部绑定到击键。
转到工具>宏> Macro IDE
添加一个新模块并使用此代码(时髦的注释用于语法突出显示)
单击“文件”>“宏 IDE”关闭并返回
点击工具>选项
单击环境>键盘
我将宏放在 MyMacros 中,因此我在“显示包含”文本框的命令”中查找“Macros.MyMacros.AttachingModule.AttachToAspNET”。
我更喜欢使用 Ctrl+Alt+D 但将您想要的任何内容放入“按快捷键”文本框中,然后单击分配,然后单击确定
现在您所要做的就是执行的操作是按 Ctrl+Alt+D 附加到所有 cassini 实例,
我在互联网上看到了各种版本的该实例 。 href="https://stackoverflow.com/questions/2512935/visual-studio-attach-to-prefer-instance-of-the-process-macro">这是最最近我发现,我必须稍微修改一下以删除额外的 Web 进程并从
WebDev.WebServer.exe
中删除 .exe,以便它可以调试 cassini 的 .net 4.0 实例。I prefer to do the exact same thing and it IS possible to bind it all to a keystroke with a macro.
Goto Tools > Macros > Macro IDE
Add a new module and use this code (the funky comments are for syntax highlighting)
Click on File > Close and return
Click on Tools > Options
Click on Environment > Keyboard
I put the macro in MyMacros, so I look for "Macros.MyMacros.AttachingModule.AttachToAspNET" in the "Show Commands Containing" textbox".
I prefer to use Ctrl+Alt+D but put whatever you want in the "Press Shortcut Keys" textbox and click Assign, then OK
Now all you have to do is hit Ctrl+Alt+D to attach to all cassini instances.
I've seen various versions of this around the internets and this was the most recent I found. I had to modify that slightly to remove the extra web processes and to drop the .exe from
WebDev.WebServer.exe
, so that it would debug .net 4.0 instances of cassini.我不知道有任何此类插件但是您可以使用快捷键并按“W”滚动到 WebDev 进程更轻松地附加到该进程。
Ctrl+Alt+P - 附加到进程
(流程窗口现在具有焦点)
按 W,跳转到以 W 开头的进程
按 Enter 附加
不是插件,但您无需触摸鼠标即可执行此操作。
I don't know of any such add-in but you can more easily attach to the process using shortcut keys and pressing 'W' to scroll to the WebDev process.
Ctrl+Alt+P - Attach to Process
(process window now has focus)
Press W, which jumps to processes starting with W
Press Enter to attach
Not an addin but you can do it without touching the mouse.
看看这个答案:Attach To Process in 2012
这是一个简单的插件,提供了快捷方式连接到 nunit 代理、IIS 和 IIS Express。与 Ctrl-Alt-P 相比,它纯粹是方便,但它很方便。
此处直接链接到插件
Check this answer out: Attach To Process in 2012
This is a simple plugin that gives shortcuts to attaching to nunit agent, IIS and IIS Express. Its pure convenience as compared to Ctrl-Alt-P, but it is convenient.
Direct link to the plugin here