[英]How to automatically attach VS to another process for debugging?
I'm debugging an ASP.NET application deployed on IIS 7.5 (VS 2010/Windows 7 x64).我正在调试部署在 IIS 7.5(VS 2010/Windows 7 x64)上的 ASP.NET 应用程序。 After I make changes, I have to deploy it to the IIS folder and then do the following things (anyone of you should already know, I just list to demonstrate how boring and time-consuming they are):
进行更改后,我必须将其部署到 IIS 文件夹,然后执行以下操作(你们应该已经知道,我只是列出来演示它们是多么无聊和耗时):
well, it's load of unnecessary works.好吧,这是一堆不必要的工作。 Due to our system architect, this is the only way, we can debug straightforward by F5 button, but I wonder that if there's a workaround about this, so I can do all these things in on-click or short-cut key.
由于我们的系统架构师,这是唯一的方法,我们可以通过 F5 按钮直接调试,但我想知道是否有解决方法,所以我可以通过单击或快捷键来完成所有这些事情。
Thank you very much.非常感谢。
http://blog.lavablast.com/post/2008/01/11/Attach-to-Process-with-one-shortcut.aspx http://blog.lavablast.com/post/2008/01/11/Attach-to-Process-with-one-shortcut.aspx
Create a macro in visual studio with the following:使用以下内容在 Visual Studio 中创建宏:
Option Strict Off
Option Explicit Off
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports System.Diagnostics
Imports System.Security.Principal
Public Module RecordingModule
Sub AttachToAspNET()
Try
Dim dbg2 As EnvDTE80.Debugger2 = DTE.Debugger
Dim trans As EnvDTE80.Transport = dbg2.Transports.Item("Default")
Dim compName As String = WindowsIdentity.GetCurrent().Name
compName = compName.Substring(0, compName.IndexOf("\"))
Dim proc2 As EnvDTE80.Process2 = dbg2.GetProcesses(trans, compName).Item("w3wp.exe")
proc2.Attach2(dbgeng)
Catch ex As System.Exception
MsgBox(ex.Message)
End Try
End Sub
End Module
change w3wp.exe to aspnet if thats what you want.如果那是您想要的,请将 w3wp.exe 更改为 aspnet。 Then go into the key shortcuts and just bind a shortcut to run that macro.
然后 go 进入快捷键并绑定一个快捷键来运行该宏。
Why don't you just go to project properties and select Use Local IIS Web Server.你为什么不只是 go 到项目属性和 select 使用本地 IIS ZC6E190B2854633C48EZ39E 服务器。
If this is remote server you can do this too: Using Visual Studio 2008 with IIS 7如果这是远程服务器,您也可以这样做: Using Visual Studio 2008 with IIS 7
Although the article is about VS2008, the concept is the same in 2010.虽然文章是关于 VS2008 的,但概念在 2010 年是一样的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.