[英]Attach VS2010 to IE9 with PowerShell to debug javascript
Problem (from nuget PowerShell): 问题(来自nuget PowerShell):
Status: 状态:
Currently I'm able from powershell (with $DTE object) to attach VS to IIS and IE9 tab process. 目前,我可以从Powershell(带有$ DTE对象)将VS附加到IIS和IE9选项卡进程。 However I'm not able to debug javascript code (I think VS by default debugs only .net code and not Script). 但是我无法调试javascript代码(我认为VS默认情况下仅调试.net代码而不调试Script)。
I saw EnvDTE80.Transport, but I don't know how to use it inside nuget PowerShell. 我看到了EnvDTE80.Transport,但是我不知道如何在nuget PowerShell中使用它。 Do you have any idea to debug js? 您有调试js的想法吗? Or a completely different approach to the problem? 还是采用完全不同的方法来解决问题?
Update (8 August): I'm able to attach to IE9 debugging js BUT I found that my problem is completely different: 更新(8月8日):我能够附加到IE9调试js,但是我发现我的问题完全不同:
BUT I attach the debugger to the processes too early and debugging doesn't work. 但是我太早将调试器附加到进程上了,调试不起作用。
I haven't done this via the VS object model but via the GUI, when you attach to a running process like IE9, you can select which debugger type you want. 我尚未通过VS对象模型完成此操作,而是通过GUI完成了此操作,当您连接到IE9等正在运行的进程时,可以选择所需的调试器类型。 In this case, you want the "Script" debugger. 在这种情况下,您需要“脚本”调试器。 If this can be done by the GUI then I suspect that it can be done via the object model. 如果这可以通过GUI完成,那么我怀疑可以通过对象模型完成。 The macro recorder in VS is good for figuring stuff like this out. VS中的宏记录器非常适合解决此类问题。 I turned it on while I did the steps to attach via the GUI and got this: 在执行通过GUI进行附加的步骤时,我将其打开并得到以下信息:
Sub TemporaryMacro()
Try
Dim dbg2 As EnvDTE80.Debugger2 = DTE.Debugger
Dim trans As EnvDTE80.Transport = dbg2.Transports.Item("Default")
Dim dbgeng(1) As EnvDTE80.Engine
dbgeng(0) = trans.Engines.Item("Script")
Dim proc2 As EnvDTE80.Process2 = dbg2.GetProcesses(trans, "HILLR1").Item("iexplore.exe")
proc2.Attach2(dbgeng)
Catch ex As System.Exception
MsgBox(ex.Message)
End Try
End Sub
I use firebug to debug Javascript in Firefox. 我使用Firebug在Firefox中调试Javascript。 Chrome has its equivalent. Chrome具有与其等效的功能。 Never tried in IE, but I think there is a Firebug version for IE. 从未尝试在IE中使用,但我认为IE有Firebug版本。
Check this question: Firebug equivalent for Internet Explorer 请检查以下问题: 相当于Internet Explorer的Firebug
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.