Snoop v2.7.0 exceptions

Feb 29, 2012 at 5: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 2.6.1.0.  I didn't get any errors during the Snoop install.


Feb 29, 2012 at 9: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
ilityChecks)
   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

Coordinator
Feb 29, 2012 at 9:52 PM

I did a quick search and found this: http://stackoverflow.com/questions/294659/why-did-i-get-an-error-with-my-xmlserializer

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

Feb 29, 2012 at 10: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.

Feb 29, 2012 at 11:16 PM

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.

Coordinator
Feb 29, 2012 at 11:30 PM

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 12: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?

Coordinator
Mar 1, 2012 at 12: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 12: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?

 

Coordinator
Mar 1, 2012 at 12: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.

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