Recently, there was logging ability added to Snoop to see why Snoop does not attach on certain machines. 

If nothing happens when trying to snoop a program, take these troubleshooting steps:

1) Go directly to the folder containing the Snoop.exe program being run.
2) Look for the file SnoopLog.txt in your temp directory. Make sure that the contents of the file are similar to this:
10/09/2011 19:06:02 : Starting the injection process...
10/09/2011 19:06:02 : GetModuleHandleEx successful
10/09/2011 19:06:02 : Got process id
10/09/2011 19:06:02 : Got process handle
10/09/2011 19:06:02 : VirtualAllocEx successful
10/09/2011 19:06:02 : SetWindowsHookEx successful
10/09/2011 19:06:05 : Successfully injected Snoop for process SnoopTestCase.vshost (PID = 7548)

(Make sure that the file ends with "Successfully injected Snoop for process processname (PID = process id)"

If the test above does not pass, contact one of the developers/coordinators (or post to a Discission), and specify what the results in the file are. If the test above passes, it means that Snoop successfully injected itself into the process being "snooped," and the problem lies in the part after the injection process. After Snoop has successfully injected itself into the process, it's running inside the process, and can write to the output window of the debugger debugging the process. At this point, look at the output window of the WPF application being debugged (and attempted to be snooped). The output window should have contents similar to this:

other messages written to output window
Got WM_GOBABYGO message
other messages written to output window
acmLocal = C:\XXX\Snoop.exe$Snoop.SnoopUI$GoBabyGo
other messages written to output window
About to load assembly C:\XXX\Snoop.exe
other messages written to output window
About to load type Snoop.SnoopUI
other messages written to output window
Just loaded the type Snoop.SnoopUI
other messages written to output window
About to invoke GoBabyGo on type Snoop.SnoopUI
other messages written to output window
Return value of GoBabyGo on type Snoop.SnoopUI is True

If you don't see the messages above, try doing this: right before trying to "snoop" your application, try setting Visual Studio to break on all CLR exceptions. Note that you may need to disable Just My Code by unchecking the Enable Just My Code (Managed Only) option.

Here are the steps to breaking on every thrown exception:
1) Go to the Debug menu in the Visual Studio instance debugging your application.
2) Choose the "Exceptions" menu. An exceptions dialog box should show up.
3) Check "Common Language Runtime Exceptions" under the "Thrown" column.
4) Now try snooping the application. If the SnoopLog.txt contains the contents mentioned above, Visual Studio will break when there's a problem trying to snoop the application. From there, you can use this information to try to troubleshoot (or you can post the information on a Discussions panel, and a developer/coordinator will get back to you).

Here are the steps to disable Just My Code:
1) Go to tools->Options.
2)  Choose Debugging.
3) Uncheck  Enable Just My Code (Managed Only).

Last edited Oct 31, 2012 at 6:36 PM by maciekrakowski, version 6

Comments

No comments yet.