tags:

views:

134

answers:

2

UPDATE: I've build a WPF app with no code behind, just put in a TextBox and a button and built it. When running this application I can see the same error in this user's machine. You can click on the button, and it works ok, but as soon as you press a key on the keyboard the application throws the same error. Should I reinstall the .Net Framework? Any other recommendations?

Original question: I have a WPF app distributed via ClickOnce in an enterprise environment. Dozens of users are running my app without issues. However there's 1 single user who can't run the app. If I log-in in his machine I also get an error. The error for the user is the standard error message when any exception occurs. So I needed to remote-debug it.

The program loads without issues and it places the focus on a TextBox as soon as the TextBox looses the focus or the user presses a key, the program crashes.

I've attached my visual studio to the my application running on the problematic machine and I managed to capture the following stack trace.

" at MS.Win32.UnsafeNativeMethods.ITfKeystrokeMgr.TestKeyUp(Int32 wParam, Int32 lParam, Boolean& eaten) at System.Windows.Input.TextServicesContext.Keystroke(Int32 wParam, Int32 lParam, KeyOp op) at System.Windows.Input.TextServicesManager.TextServicesKeystroke(TextServicesContext context, KeyEventArgs keyArgs, Boolean test) at System.Windows.Input.TextServicesManager.PreProcessInput(Object sender, PreProcessInputEventArgs e) at System.Windows.Input.InputManager.ProcessStagingArea()\r\n at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) at System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey) at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled) at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers) at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) at System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(MSG& msg, Boolean& handled) at System.Windows.Interop.HwndSource.WeakEventPreprocessMessage.OnPreprocessMessage(MSG& msg, Boolean& handled) at System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.Run() 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 TIS.SamSeek.WpfClient.App.Main()"

I get a System.Argument exception with the description: "Value does not fall within the expected range.".

InnerException: null
Source: WindowsBase
TargetSite: {Void TestKeyUp(Int32, Int32, Boolean ByRef)} DeclaringType: {Name = "ITfKeystrokeMgr" FullName = "MS.Win32.UnsafeNativeMethods+ITfKeystrokeMgr"}
Assembly: {WindowsBase, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35}
Declaring method: '((System.Type)(((System.Reflection.MemberInfo)(((System.Exception)($exception)).TargetSite)).DeclaringType)).DeclaringMethod' threw an exception of type 'System.InvalidOperationException'
Message: "Method may only be called on a Type for which Type.IsGenericParameter is true."
source: "mscorlib"

I put all kinds of traces in the code and I am pretty sure that my code is not directly causing this exception. I do not have any KeyUp events in my code.

What do you suggest?

Thanks a lot

+1  A: 

My Psychic Debugger says it's something to do with the tablet input service. Office tends to install weird versions of it, which cause problems. What version of Windows is it?

Paul Betts
Paul, thanks for your help. It is running on XP Pro SP3. You may be on to something because I can see the language bar showing with handwriting recognition options. Do you have any other suggestions on what I could be looking for? Thanks
Gustavo Cavalcanti
A: 

Paul, you gave me a great hint. The Windows language bar had handwriting and voice recognition options turned on. When I turned these options off my app works fine! What's up with that??!?!?!?!

Gustavo Cavalcanti
I think it's a known bug, I had a machine where whenever I plugged in a tablet, all my WPF apps would crash
Paul Betts
I am glad you read my question and gave me your input. I would not have caught that on my own. Thanks again.
Gustavo Cavalcanti
The user has a handwriting recognition pen that writes on regular paper. I assume the handwriting recognition piece is that same that runs on a tablet.
Gustavo Cavalcanti