Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

.NET 3.0 WPF Error: CriticalFromVisual() Value cannot be null Parameter name: v

$
0
0

We have an application that is mixed .NET winforms and WPF.  It's a classic tabbed app with the workflow progressing as the user moved through the tabs.  One of the tabs is hosting WFP controls, basically a grid containing controls.  The computer is touch enabled but with a mouse and a keyboard as well.  It's a medical application and runs in 10 special areas of a hospital.

About once a day in one of the rooms there will be this error:

Stack Trace from hotfix page:
PresentationCore.dll!System.Windows.PresentationSource.CriticalFromVisual(System.Windows.DependencyObject v, bool enable2DTo3DTransition)
PresentationFramework.dll!System.Windows.Controls.PopupControlService.OnPostProcessInput(object sender, System.Windows.Input.ProcessInputEventArgs e)

We cannot reproduce this error and it only happens with the users randomly.  Additionally the users are only able to remember small details about what they were doing when the error happened.  It's not clear if the users mostly use the mouse or touch, my guess is they're more comfortable using the mouse.  The touch monitor has multi-touch capabilities but due to other issues we have it configured for single touch only.

I have located the following hotfix from Apr-2012 that has a stack trace that seems identical:

KB 2486856  (When my account is verified I'll add a proper link)

support.microsoft.com/en-us/kb/2486856

I have also been able to get the .NET dlls from these machines and they are from Apr-2013 and appear to be part of a later .NET framework rollup / service pack.

I was also able to set a breakpoint inside the PresentationCore.CriticalFromVisual() method and inspect the stack trace. What I was hoping for was somewhere in the stack I could see my code and then add a try/catch for this error and possibly continue. However the stack trace goes fully through MS code and ends in the in my Main() and by then it's too late for a retry.

I decompiled the 4.0 files and working up the call stack, the place where parameter "v" is retrieved (PresentationFramework.dll -- PopupControlService.OnPostProcessInput) there's a null check and if null the code returns.  This logic isn't in any of the 3.0 code that I can find.  My development machine has 3.0 DLL's from Jul-2015 and these too do not contain the null check.

So I'm down to a couple of options:

  1. Maybe the hotfix I found isn't the actual issue and there's a later fix? (after Apr-2013)
  2. Or there's a way to insert code in the call stack and do a try / catch to ignore the error.
  3. This isn't a bug in the MS code and I've done something wrong (what???)
  4. Other options???

All we can get is a cell phone camera screen shot, which is infinitely better than nothing at all : )

When my account is verified, I'll add the screen shot image.

 


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>