SNOOP-ing crashes app

Feb 25, 2010 at 5:48 PM

I am currently trying to SNOOP into a WinForms application hosting a WPF dll.  I can Magnify the UI fine, but when ever I try to SNOOP it, my app crashes with the following error:

 

An unhandled exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
Additional information: Exception has been thrown by the target of an invocation.

An unhandled exception of the type 'System.Reflection.TargetInvocationExceptio' occurred in mscorlib.dll.  I have tried debugging SNOOP and the exception occurs on line 84 of Injector.cpp.

 

Thanks 

Aaron

 

Coordinator
Feb 25, 2010 at 9:32 PM

Hmm. I haven't seen that before ... and one of my first modifications to Snoop was to get it working in the exact scenario you mention.

If you draft up a small repro project and send it to me, I'll take a look.

My email is my first name, Cory, followed by my last name, Plotts, (no space) at gmail.com.

Mar 2, 2010 at 12:32 PM

Just wanted to add some details here in case others have/do run into this situation:

The app I am trying to SNOOP is a Winforms application hosting an activeX dll whose main class is a System.Windows.Form.UserControl who uses a System.Windows.Forms.Integration.ElementHost to display the wpf usercontrols. I have started creating a wpf host for my dll, which SNOOP can sorta successfully snoop. I can successfully snoop into my wpf host application it does not show(snoop or magnify) any of the objects under the ElementHost, which it does when I magnify the forms based host.

I have communicated with Cory and he admits this is more complex than they had tested, but will try to investigate when he has time.

Coordinator
Mar 2, 2010 at 1:11 PM

Just to clarify, Snoop should work with straightforward Windows Forms interop. I have not (personally) tried any interop scenarios with ActiveX.

However, I would love to add that support ... if someone figures out what is wrong!

Jun 7, 2010 at 2:54 PM

I am having the exact same problem, i.e. pressing the snoop button causes my application to crash. I am trying to snoop an application built on .net fw 4.0 and in my case there is no WinForms involved at all. Using the magnifier works for me as well but snooping doesn't. It would be great if it had worked. There is absolutely a need for such an application when developing applications using WPF.

Error message:

Problem signature:
  Problem Event Name:    CLR20r3
  Problem Signature 01:    xxxxxxxxxxxxxxxxxxxxxxxx
  Problem Signature 02:    1.0.0.0
  Problem Signature 03:    4c0896e2
  Problem Signature 04:    Snoop
  Problem Signature 05:    2.5.1.0
  Problem Signature 06:    4bf70b49
  Problem Signature 07:    47
  Problem Signature 08:    2a
  Problem Signature 09:    System.NullReferenceException
  OS Version:    6.1.7600.2.0.0.256.4
  Locale ID:    1053
  Additional Information 1:    0a9e
  Additional Information 2:    0a9e372d3b4ad19135b953a78882e789
  Additional Information 3:    0a9e
  Additional Information 4:    0a9e372d3b4ad19135b953a78882e789

 

Coordinator
Jun 7, 2010 at 3:05 PM
Gripenstedt: sounds like your problem is different than Aaron's above (at least no Windows Forms). Why did you reply to this thread ... does your application host WPF in an ActiveX control? One thing you could try ... is to download Snoop yourself, build it, and see exactly where it is crashing. To do so, follow these steps:
  1. Launch the application that you want to Snoop.
  2. Launch Snoop (only the application chooser ... don't try to Snoop anything just yet).
  3. Bring up the Snoop project inside of Visual Studio and Debug/Attach to Process on the application you want to Snoop (the thing you launched in #1).
  4. Set a breakpoint somewhere in the Snoop code. I would suggest SnoopUI.GoBabyGo.
  5. Finally, use Snoop's application chooser to select and Snoop the application you've been trying to Snoop (again, the thing you launched in #1).
  6. Your breakpoint should get hit.
Coordinator
Jun 7, 2010 at 3:07 PM
agrahamatfes wrote:

Just wanted to add some details here in case others have/do run into this situation:

The app I am trying to SNOOP is a Winforms application hosting an activeX dll whose main class is a System.Windows.Form.UserControl who uses a System.Windows.Forms.Integration.ElementHost to display the wpf usercontrols. I have started creating a wpf host for my dll, which SNOOP can sorta successfully snoop. I can successfully snoop into my wpf host application it does not show(snoop or magnify) any of the objects under the ElementHost, which it does when I magnify the forms based host.

I have communicated with Cory and he admits this is more complex than they had tested, but will try to investigate when he has time.

Aaron: I've been working on bug fixes lately. If you could create a simple test harness which illustrates your scenario and problem (in particular, ActiveX being in the middle of things) ... I will take a look.

Jun 7, 2010 at 3:11 PM

Unfortunately I have moved on to a new project already so I do not have time to do this.  If I have any future projects that lead that way I will try again.

Thanks for your support.

Aaron

From: cplotts [mailto:notifications@codeplex.com]
Sent: Monday, June 07, 2010 11:08 AM
To: Aaron Graham
Subject: Re: SNOOP-ing crashes app [snoopwpf:197445]

From: cplotts

agrahamatfes wrote:

Just wanted to add some details here in case others have/do run into this situation:

The app I am trying to SNOOP is a Winforms application hosting an activeX dll whose main class is a System.Windows.Form.UserControl who uses a System.Windows.Forms.Integration.ElementHost to display the wpf usercontrols. I have started creating a wpf host for my dll, which SNOOP can sorta successfully snoop. I can successfully snoop into my wpf host application it does not show(snoop or magnify) any of the objects under the ElementHost, which it does when I magnify the forms based host.

I have communicated with Cory and he admits this is more complex than they had tested, but will try to investigate when he has time.

Aaron: I've been working on bug fixes lately. If you could create a simple test harness which illustrates your scenario and problem (in particular, ActiveX being in the middle of things) ... I will take a look.

Read the full discussion online.

To add a post to this discussion, reply to this email (snoopwpf@discussions.codeplex.com)

To start a new discussion for this project, email snoopwpf@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com

Coordinator
Jun 7, 2010 at 3:18 PM
Aaron: Ok, thanks for the heads up. I just reread your thread and your scenario was pretty complex (Windows Forms hosting ActiveX hosting Windows Forms hosting WPF). Yikes!
Jun 7, 2010 at 3:21 PM

Yep, that is what we get for try to shoe horn new tech into an existing application

Aaron

From: cplotts [mailto:notifications@codeplex.com]
Sent: Monday, June 07, 2010 11:19 AM
To: Aaron Graham
Subject: Re: SNOOP-ing crashes app [snoopwpf:197445]

From: cplotts

Aaron: Ok, thanks for the heads up. I just reread your thread and your scenario was pretty complex (Windows Forms hosting ActiveX hosting Windows Forms hosting WPF). Yikes!

Read the full discussion online.

To add a post to this discussion, reply to this email (snoopwpf@discussions.codeplex.com)

To start a new discussion for this project, email snoopwpf@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com

Coordinator
Jun 7, 2010 at 3:24 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Jun 7, 2010 at 3:25 PM
Edited Jun 7, 2010 at 3:29 PM
I have the made the ActiveX interop story part of this thread ... a work item.
Jun 7, 2010 at 3:32 PM
I downloaded the latest build, compiled it and now its working. Thanks for the help.

/Andreas

On Mon, Jun 7, 2010 at 5:25 PM, cplotts <notifications@codeplex.com> wrote:

From: cplotts

I have the made the ActiveX interop story part of this thread ... a work item: http://snoopwpf.codeplex.com/workitem/4844

Read the full discussion online.

To add a post to this discussion, reply to this email (snoopwpf@discussions.codeplex.com)

To start a new discussion for this project, email snoopwpf@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Coordinator
Jun 7, 2010 at 3:38 PM
Edited Jun 7, 2010 at 3:40 PM
Gripenstedt wrote:
I downloaded the latest build, compiled it and now its working. Thanks for the help.

/Andreas

Andreas: I was hoping that the latest build would work for you ... even though I gave you instructions to debug it. Glad to hear it! I probably should do another release sometime soon.