none
Application gets crashed when system culture is changed giving CultureNotFoundException. RRS feed

  • Question

  • Hi,

    I have a Winforms application which has a WPF textbox and a Winforms textbox. I have installed a Bhutan locale (Dzongkha), its keyboard and fonts. When the application is running and I change the system culture from [en-US] to [dz-BT](Dzongkha- Bhutan), the moment I try to type something in WPF textbox, application gets crashed, giving a Culture not supported error. I have tried creating custom culture, but that didn't work for me either. I am clueless as to how to go about this problem. Any help would be really appreciated.

    Thanks in advance.

    Monday, April 13, 2015 10:33 AM

All replies

  • Hello C.Mitt,

    >> , application gets crashed, giving a Culture not supported error

    With current information, it is hard to tell what part causes this exception. Does this error has a detail description? If has, please share it with us.

    >> I have tried creating custom culture, but that didn't work for me either.

    Does it also throw an error?

    Here are links which could help debug an application crash:

    Use Dump Files to Debug App Crashes and Hangs in Visual Studio

    If you are in a product environment, please refer to this link:

    http://blogs.msdn.com/b/msdnts/archive/2006/11/24/how-to-debug-application-crash-hang-in-production-environment.aspx

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, April 14, 2015 11:26 AM
    Moderator
  • Hi,

    I am copying the stack trace here. Also, I will be attaching screenshots of the error. If you want, I can give a sample application to replicate the error.

    STACK TRACE :-

       at System.Globalization.CultureInfo.InitializeFromCultureId(Int32 culture, Boolean useUserOverride)
       at System.Globalization.CultureInfo..ctor(Int32 culture, Boolean useUserOverride)
       at System.Windows.Input.InputLanguageSource.get_CurrentInputLanguage()
       at System.Windows.Input.InputLanguageManager.get_CurrentInputLanguage()
       at System.Windows.Documents.TextEditorTyping.DoTextInput(TextEditor This, String textData, Boolean isInsertKeyToggled, Boolean acceptControlCharacters)
       at System.Windows.Documents.TextEditorTyping.TextInputItem.Do()
       at System.Windows.Documents.TextEditorTyping.ScheduleInput(TextEditor This, InputItem item)
       at System.Windows.Documents.TextEditorTyping.OnTextInput(Object sender, TextCompositionEventArgs e)
       at System.Windows.Controls.Primitives.TextBoxBase.OnTextInput(TextCompositionEventArgs e)
       at System.Windows.UIElement.OnTextInputThunk(Object sender, TextCompositionEventArgs e)
       at System.Windows.Input.TextCompositionEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at System.Windows.Input.TextCompositionManager.UnsafeCompleteComposition(TextComposition composition)
       at System.Windows.Input.TextCompositionManager.PostProcessInput(Object sender, ProcessInputEventArgs e)
       at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(ProcessInputEventHandler postProcessInput, ProcessInputEventArgs processInputEventArgs)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at System.Windows.Input.TextCompositionManager.UnsafeStartComposition(TextComposition composition)
       at System.Windows.Input.TextCompositionManager.PostProcessInput(Object sender, ProcessInputEventArgs e)
       at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(ProcessInputEventHandler postProcessInput, ProcessInputEventArgs processInputEventArgs)
       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.ProcessTextInputAction(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at System.Windows.Interop.HwndKeyboardInputProvider.FilterMessage(IntPtr hwnd, WindowMessage message, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at WindowsFormsApplication2.Program.Main() in C:\Users\cheshta.mittal\Documents\Visual Studio 2010\Projects\WindowsFormsApplication1\WindowsFormsApplication2\Program.cs:line 18
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()

    PS: I am not able to paste screenshots.

    Regards.



    • Edited by C.Mitt Tuesday, April 14, 2015 12:48 PM
    Tuesday, April 14, 2015 12:34 PM
  • Hi,

    From the exception stack trace. It's hardly to address this issue. I would suggest you provide a sample about this issue.

    Here are some tips:

    1. I check the description of this exception. 

    The exception thrown when a method is invoked which attempts to construct a culture that is not available on the machine.

    You should make sure Dzongkha- Bhutan culture has installed in your machine.

    2. From the stack trace, It's a .NET 4.0 application. I would suggest you install all latest updates for .NET Framework.

    Regards,

    The future belongs to those who believe in the beauty of their dreams.

    Thursday, April 16, 2015 10:01 AM