title: When using Visual Studio, I get a "Object reference not set to instance of an object" error. How do I fix this error?
body: <p>I'm getting the following error when using Visual Studio.</p>
  
  <p>For an unknown reason and at unpredictable times, the error starts showing up when I type into text boxes/fields in Visual Studio.</p>
  
  <p>I can click items/objects, but I'm unable to use the keyboard to type into text boxes.</p>
  
  <p>I primarily use Visual Studio for SQL development (SSIS, SSRS). We also use Team Foundation Server.</p>
  
  <p>The only way I've found to fix the issue is to close and reopen Visual Studio. However, after a little while, the error returns. Unsure what causes the error to start happening.</p>
  
  <p>See below for details:</p>
  
  <p><strong>Visual Studio Version</strong>
  Microsoft Visual Studio Professional 2017
  Version 15.9.15
  Installed Version: Professional</p>
  
  <p><strong>Error Details:</strong></p>
  
  <pre><code>Object reference not set to an instance of an object. (Microsoft Visual Studio)
  
  ------------------------------
  Program Location:
  
     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()
     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&amp; msg, Boolean&amp; handled)
     at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG&amp; msg, ModifierKeys modifiers)
     at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)
     at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
     at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
  </code></pre>