PC Review


Reply
Thread Tools Rate Thread

Attaching debugger in a macro

 
 
Chris Dunaway
Guest
Posts: n/a
 
      12th Apr 2004
I am using the following code in a macro to attach to a process:

Dim sFilename As String = "progname.exe"
Dim proc As EnvDTE.Process
For Each proc In DTE.Debugger.LocalProcesses
If (Right(proc.Name, sFilename.Length) = sFilename) Then
proc.Attach()
attached = True
Exit For
End If
Next

Progname.exe is a VB.Net program compiled in Debug mode.

When it runs, I get an error message that says: "Unmanaged Debugging Not
Available"

How do I attach to a managed program using a macro?


--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
 
Reply With Quote
 
 
 
 
Visual C# Team
Guest
Posts: n/a
 
      15th Apr 2004
Unfortunitely, you can't. The automation support for attach in VS.NET 2002
and 2003 was very limited. It didn't let you specify what kind of code that
you want to debug. Instead, it required debugging all the code in the
process. However, it sounds like you have VB.NET, which doesn't support
debugging unmanaged code. You need to either use full VS, or you need to
attach via the processes dialog.

Sorry,

--
Gregg

This posting is provided "AS IS", with no warranties, and confers no rights.
"Chris Dunaway" <dunawayc@_lunchmeat_sbcglobal.net> wrote in message
news:vm1l2fm1172a$.1pjntkhipluer$.(E-Mail Removed)...
> I am using the following code in a macro to attach to a process:
>
> Dim sFilename As String = "progname.exe"
> Dim proc As EnvDTE.Process
> For Each proc In DTE.Debugger.LocalProcesses
> If (Right(proc.Name, sFilename.Length) = sFilename) Then
> proc.Attach()
> attached = True
> Exit For
> End If
> Next
>
> Progname.exe is a VB.Net program compiled in Debug mode.
>
> When it runs, I get an error message that says: "Unmanaged Debugging Not
> Available"
>
> How do I attach to a managed program using a macro?
>
>
> --
> Chris
>
> To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
> address.



 
Reply With Quote
 
Habib Heydarian [MSFT]
Guest
Posts: n/a
 
      16th Apr 2004
What version of Visual Studio are you using? It sounds like you're using a
version that doesn't have the native debugging engine. In Visual Studio
2002/2003, the Process.Attach() call will attach with the "Native" debug
engine if there's only native code running. If there's managed code, it will
attach in interop mode.

HabibH.

"Chris Dunaway" <dunawayc@_lunchmeat_sbcglobal.net> wrote in message
news:vm1l2fm1172a$.1pjntkhipluer$.(E-Mail Removed)...
> I am using the following code in a macro to attach to a process:
>
> Dim sFilename As String = "progname.exe"
> Dim proc As EnvDTE.Process
> For Each proc In DTE.Debugger.LocalProcesses
> If (Right(proc.Name, sFilename.Length) = sFilename) Then
> proc.Attach()
> attached = True
> Exit For
> End If
> Next
>
> Progname.exe is a VB.Net program compiled in Debug mode.
>
> When it runs, I get an error message that says: "Unmanaged Debugging Not
> Available"
>
> How do I attach to a managed program using a macro?
>
>
> --
> Chris
>
> To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
> address.



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Attaching debugger remotely? Brett Romero Microsoft C# .NET 3 15th Sep 2006 05:14 AM
Attaching A Debugger (CLR 2.0) elziko Microsoft Dot NET 0 15th Dec 2005 04:58 PM
Attaching the .net debugger to process DaveF Microsoft VB .NET 1 31st Dec 2004 07:19 PM
Attaching debugger Sajjad Akhter Microsoft Dot NET Framework 6 9th Nov 2004 10:04 AM
Attaching a Process to the VS Debugger Saradhi Microsoft C# .NET 0 23rd Jun 2004 10:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:54 PM.