This project has moved and is read-only. For the latest updates, please go here.

Snoop v2.7.0 exceptions

Feb 29, 2012 at 6:48 PM

I needed to examine my WPF application so I just now downloaded and installed the latest version.  I'm running from the Visual Studio 2010 debugger, .NET4, Windows7.  When I click on the binoculars for my app, I get a System.Reflection.TargetInvocationException.  So I tried it on a smaller WPF test application and on that I get System.IO.File.Not.FoundException for Snoop.XmlSerializers, Version  I didn't get any errors during the Snoop install.

Feb 29, 2012 at 10:06 PM

I tried running my app outside of the debugger and Snooping it and I get:

Unhandled Exception: System.Reflection.TargetInvocationException: Exception has
been thrown by the target of an invocation. ---> System.NullReferenceException:
Object reference not set to an instance of an object.
   at Snoop.SnoopUI.GoBabyGo()
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Ob
ject target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAt
tributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Obj
ect target, Object[] arguments, Signature sig, MethodAttributes methodAttributes
, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke
Attr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisib
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invoke
Attr, Binder binder, Object[] parameters, CultureInfo culture)
   at MessageHookProc(Int32 nCode, UInt32 wparam, Int32 lparam)
   at MS.Win32.UnsafeNativeMethods.IntGetMessageW(MSG& msg, HandleRef hWnd, Int3
2 uMsgFilterMin, Int32 uMsgFilterMax)
   at MS.Win32.UnsafeNativeMethods.GetMessageW(MSG& msg, HandleRef hWnd, Int32 u
MsgFilterMin, Int32 uMsgFilterMax)
   at System.Windows.Threading.Dispatcher.GetMessage(MSG& msg, IntPtr hwnd, Int3
2 minMessage, Int32 maxMessage)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()
   at LWDMatch.App.Main() in D:\src\LWDMatch\obj\Debug\App.g.cs:line 0

Feb 29, 2012 at 10:52 PM

I did a quick search and found this:

See if anything in there helps you. Report back if it does.

Feb 29, 2012 at 11:37 PM

I guess I wasn't clear.  My app runs fine until I try to Snoop it and then I get this error as soon as I click on the binoculars.  I'm not doing any overt XML serializing.

Mar 1, 2012 at 12:16 AM

Okay, for the test app I turned off all the Visual Studio 2010 'exceptions' and now I can Snoop it with the XMLSerializers missing exception. But still get the exception on my main app even with all the VS exceptions turned off.

Mar 1, 2012 at 12:30 AM

I did understand you ... Snoop is not doing any XML serializing either. I've heard of this error once before ... but I have never been able to reproduce it.

What I would do, if I were you, is to download the source code for Snoop and debug it yourself. If you can pinpoint where the exception is getting thrown ... or why ... that would be a big help. I mean, I can see that it is probably happening in the GoBabyGo method from the stack above ... but where at in that method?

Let me know if you discover anything.

Mar 1, 2012 at 1:03 AM

Okay, I downloaded and built the debug version and when I run with that I don't get any exception and can Snoop fine.  I don't have Wix so I don't know if I could build a release version or not but at this point I'd suspect some kind of release optimization maybe causing it to act differently than the debug version?

Mar 1, 2012 at 1:07 AM

Try building the release version ... and using that. I would be curious to know if you then get the exception.

And, yes, if you don't have WiX installed, you won't be able to build the installer. That's okay, though. You can either unload the installer project or just let it fail.

Let me know if you still get the exception with the Release (but built) version.

Mar 1, 2012 at 1:40 AM

I build the Release version and tried with that.  Now I'm getting an error message box about failing to attach to my app because it can't find the file specified, even though the message is showing the name and title bar from my app.  I have a jpeg of the error but don't see a way to attach an image to a message here?


Mar 1, 2012 at 1:47 AM

I'm going to copy this discussion to a work item ... you can attach the jpg there ... as well as your small test harness. Give me a moment to create the work item.

Mar 1, 2012 at 1:50 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.