none
WPF PageFunction: Exceptions in downloaded examples

    Question

  • Hello,

    I am looking at the Page-Functions so I read the documantation and downloaded some examples.

    http://msdn.microsoft.com/en-us/library/aa972122.aspx: Structured Navigation Sample
    http://msdn.microsoft.com/en-us/library/aa972123.aspx: the wizard sample.

    I get an error in all the examples.

    When I start with the first example and I click on the first arrow just after the window opend (wich should not be working at all and is greyed-out) I get the error: System.ArgumentException: De aangevraagde waarde LINKS is niet gevonden.

     Whenever I go to the first navigation-page and try to insert a text in the textbox it fails on the statement:
    System.ArgumentException was unhandled
    Exception:

      Message="De aangevraagde waarde LINKS is niet gevonden."
      Source="mscorlib"
      StackTrace:
           bij System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
           bij System.Windows.Input.KeyConverter.GetKey(String keyToken, CultureInfo culture)
           bij System.Windows.Input.KeyConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object source)
           bij System.Windows.Input.KeyGestureConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object source)
           bij System.ComponentModel.TypeConverter.ConvertFromInvariantString(String text)
           bij System.Windows.Input.KeyGesture.CreateFromResourceStrings(String keyGestureToken, String keyDisplayString)
    ........................
           bij System.Windows.Application.Run()
           bij XamlGeneratedNamespace.GeneratedApplication.Main() in C:\Users\Annet\Documents\Visual Studio 2008\Projects\StructuredNavigationSample\csharp\obj\Debug\App.g.cs:regel 0
           bij System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
           bij System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
           bij Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
           bij System.Threading.ThreadHelper.ThreadStart_Context(Object state)
           bij System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
           bij System.Threading.ThreadHelper.ThreadStart()
      InnerException:


    I have Visual Studio 2008 SP1 installed

    I really would like to use this in my application, so does anybody know what is the matter here ??




    Friday, February 6, 2009 3:53 PM

Answers

All replies

  • Hi Afva,
        You are hitting an over-localization bug... i.e. something has set a string value in markup that gets parsed expecting a language-invariant enumeration value, but fails.    It took some debugging, especially since I dont speak Dutch, but I learned that Links = "Left" in Dutch.

    So the bug is this:

    - You click the button (even though it's disabled)
    - The button tries to load the KeyGesture from the Dutch resource assemblies in the GAC. 
    - On MY machine (Tried XPSP3 + NL lang packs for .NET and OS) , the particular KeyGesture string is "Alt+Left" and the Display name (since Links = Left in Dutch) is "Alt+Links"
    - On your machine, the same resource has both its Token and Display String set to "Alt+Links".
         - Since there is not a keyboard key associated with "Links", the above call stack results.


    The trick now is to find out what exact scenario one needs to follow to get the invalid resource DLLs, since I cannot repro your issue here but it looks quite real.

    Can you first make sure that the version of your WPF resource DLLs on the machine are the Sp1 version?   You may have stale earlier resources on the machine...
        -  Should look like this: 3.0.6920.1427 built by: SP

    Failing that, all the details you can provide about your OS, Architecture (Amd64 or x86), and how you got to the particular VIsual Studio and .NET install you have on your machine.

    Thanks,
    Matt
    SDET : Deployment/Hosting
    • Marked as answer by Tao Liang Wednesday, February 11, 2009 5:32 AM
    • Unmarked as answer by afva Wednesday, February 11, 2009 9:34 AM
    Tuesday, February 10, 2009 6:34 PM
    Moderator
  • Hi MAtt,

    Thanks for your response, and sorry for the Dutch language.

    I work on a X86 Windows Vista.
    (Microsoft® Windows Vista™ Business;  Versie 6.0.6001 Service Pack 1 Build 6001)

    When I look in the about Box I get the following information:

    Microsoft Visual Studio 2008
    Version 9.0.21022.8 RTM
    Microsoft .NET Framework
    Version 3.5 SP1

    Installed Edition: Professional

    Microsoft Visual Basic 2008   91605-130-0227523-60975
    Microsoft Visual Basic 2008

    Microsoft Visual C# 2008   91605-130-0227523-60975
    Microsoft Visual C# 2008

    Microsoft Visual C++ 2008   91605-130-0227523-60975
    Microsoft Visual C++ 2008

    Microsoft Visual Studio 2008 Tools for Office   91605-130-0227523-60975
    Microsoft Visual Studio 2008 Tools for Office

    Microsoft Visual Web Developer 2008   91605-130-0227523-60975
    Microsoft Visual Web Developer 2008

    Crystal Reports    AAJ60-G0MSA4K-68000CF
    Crystal Reports Basic for Visual Studio 2008


    Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB944899)   KB944899
    This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/944899.

    Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB945282)   KB945282
    This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/945282.

    Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB946040)   KB946040
    This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/946040.

    Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB946308)   KB946308
    This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/946308.

    Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB946344)   KB946344
    This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/946344.

    Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB946581)   KB946581
    This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/946581.

    Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947171)   KB947171
    This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/947171.

    Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947173)   KB947173
    This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/947173.

    Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947180)   KB947180
    This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/947180.

    Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947540)   KB947540
    This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/947540.

    Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB947789)   KB947789
    This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/947789.

    Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB948127)   KB948127
    This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/948127.

    Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB952241)   KB952241
    This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/952241.

    Hotfix for Microsoft Visual Studio 2008 Professional Edition - ENU (KB953256)   KB953256
    This hotfix is for Microsoft Visual Studio 2008 Professional Edition - ENU.
    If you later install a more recent service pack, this hotfix will be uninstalled automatically.
    For more information, visit http://support.microsoft.com/kb/953256.


    Does this help you ? Or do I have to look somwhere else for the library's version???

    Thanks,

    Wednesday, February 11, 2009 9:33 AM
  • Your version info is interesting but not what I'm looking for.  It's notable that you have VS 2008 RTM but .NET Framework 3.5 Sp1.  (2008 SP1 version is 9.0.30729.1) ... that might be interesting to patch to SP1 and see if it helps, but it's not likely related since the issue here is with a resource DLL.

    Try opening up an Explorer window and browsing to %Windir%\assembly.  This is a nice visual representation of the contents of the Global Assembly cache.  Sort the assemblies listed here by "Culture" and go to the NL resources.  Check the version #'s of Presentation*.resources (Core, Framework) and WindowsBase.resources.  (Properties / Version).   On my 3.5 Sp1 machine using language packs installed from the web, I see 3.0.6920.1427, the 3.0 SP2 version # for these assemblies.  If you have any earlier version, a repair install will likely fix your problem.  If not, I need to try the scenario on a pure NL machine since it doesnt work on a localized en-us machine with the Nl-Nl language packs.

    HTH,
    Matt

    SDET : Deployment/Hosting
    Wednesday, February 11, 2009 5:15 PM
    Moderator
  • hi,
    i'm the guy from the other thread (http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/5993682b-d61f-4657-915e-799896212984) i've requested to a dutch user
    of my App to give me some info that you request in here, he sent me some screenshots, you can download a zip file with the 3ss on it (http://www.megaupload.com/pt/?d=X29MRXU1)
    or see it:
    http://img14.imageshack.us/img14/5819/ss1ga3.jpg
    http://img16.imageshack.us/img16/1241/ss2vm5.jpg
    http://img10.imageshack.us/img10/362/ss3ir3.jpg


    the guy who send me this is using Windows Vista Ultimate Dutch version, he said that he had format his machine, and installed all again today, and the problem is still there, in the screenshots
    he sent me his windows update history, i hope that this screenshots could help you fixing this

    tks
    Wednesday, February 11, 2009 7:42 PM
  • (Pasting from other thread)
     I have gotten a repro over here on the WPF side of things, and have opened a high priority bug to track this.  I'm not sure when a fix will be available, but the issue is now at least known and documented.

    -Matt
    SDET : Deployment/Hosting
    • Marked as answer by Tao Liang Monday, February 16, 2009 1:50 AM
    Thursday, February 12, 2009 12:00 AM
    Moderator
  • Hi Matt,

    I've looked at the other post and I have the same versions overhere: 3.0.6920.14553

    Thanks for the looking at the problem.

    Thursday, February 12, 2009 9:08 AM
  • Same error on Dutch version of Windows Vista Business SP1 (fully updated as of Feb 13, 07:00 AM (CET)):

    PresentationBuildTasks.resources             3.0.6920.1453  
    PresentationCore.resources                   3.0.6920.1453  
    PresentationFramework.resources              3.0.6920.1453  
    PresentationUI.resources                     3.0.6920.1453  
    WindowsBase                                  3.0.6920.1453 

    So it's not only on Ultimate. See also my posts in the other thread.

    hth,
    Marcel

    Friday, February 13, 2009 6:42 AM
  • I am experiencing the same problems on Vista Business x86 with Dutch language. ("Value left is not found")
    Is there yet a solution or a hotfix available?

    Thanks in advance
    Tuesday, February 24, 2009 2:07 PM
  • CodeItaWAY said:

    I am experiencing the same problems on Vista Business x86 with Dutch language. ("Value left is not found")
    Is there yet a solution or a hotfix available?

    Thanks in advance


    Hi, i dont know if there is any hotfix for this already, but a dutch user of my application found a workarround for this, he says that removing the "kb949249" update fixes the problem, here goes his instructions to do that:
    Vista:
    1. Ga naar start
    2. Ga naar computer
    3. Boven in het scherm staat systeemeigenschappen, ga daar naar toe
    4. Kik linksonder op Windows Update
    5. Linksonder klik op Geïnstalleerde Updates
    6. Druk ctrl+f
    7. voer kb949 in
    8. nu blijven er een paar over
    9. kies kb949249
    10. Dit bestand moet je deinstaleren
    11. Verwijder het bestand daar of ga terug naar het begin scherm om hem te kunnen verwijderen
    Tuesday, February 24, 2009 2:14 PM
  • Correct, a hotfix is unfortunately not available yet.  Given how little UI there actually is for the .NET Framework, uninstalling the dutch language packs sounds a reasonable workaround... since it's the only option for now.

    -Matt
    SDET : Deployment/Hosting
    Tuesday, February 24, 2009 5:06 PM
    Moderator
  • I cannot find kb949249 in the list...
    Is it not included in Windows Vista SP2?
    I still have the problem...
    Monday, August 3, 2009 8:07 AM
  • I got the same problem, before installing Vista SP2 the workaround deleting KB949249 worked for me.
    But after installing Vista SP2 the problem is back.........

    Waiting for a bugfix from MS. This is a big problem for our company, developing new software and releasing it in 1 or 2 months to customers using Vista Dutch SP2!!!
    Wednesday, August 5, 2009 8:43 AM
  • After searching ourself for a solution looking at the exception message:


    ystem.ArgumentException: De aangevraagde waarde LINKS is niet gevonden.
       bij System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
       bij System.Windows.Input.KeyConverter.GetKey(String keyToken, CultureInfo culture)
       bij System.Windows.Input.KeyConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object source)
       bij System.Windows.Input.KeyGestureConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object source)
       bij System.ComponentModel.TypeConverter.ConvertFromInvariantString(String text)
       bij System.Windows.Input.KeyGesture.CreateFromResourceStrings(String keyGestureToken, String keyDisplayString)
       bij System.Windows.Input.KeyGesture.AddGesturesFromResourceStrings(String keyGestures, String displayStrings, InputGestureCollection gestures)
       bij System.Windows.Input.NavigationCommands.LoadDefaultGestureFromResource(Byte commandId)
       bij System.Windows.Input.RoutedCommand.GetInputGestures()
       bij System.Windows.Input.RoutedCommand.get_InputGesturesInternal()
       bij System.Windows.Input.CommandBindingCollection.FindMatch(Object targetElement, InputEventArgs inputEventArgs)
       bij System.Windows.Input.CommandManager.TranslateInput(IInputElement targetElement, InputEventArgs inputEventArgs)
       bij System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
       bij System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       bij System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       bij System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       bij System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       bij System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       bij System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       bij System.Windows.Input.InputManager.ProcessStagingArea()
       bij System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       bij System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       bij System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
       bij System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       bij System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       bij MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       bij MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       bij System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
       bij System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       bij System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       bij System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
       bij System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       bij MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       bij MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       bij System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       bij System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       bij System.Windows.Threading.Dispatcher.Run()
       bij System.Windows.Application.RunDispatcher(Object ignore)
       bij System.Windows.Application.RunInternal(Window window)
       bij System.Windows.Application.Run(Window window)
       bij System.Windows.Application.Run()
       bij Prodigy.UserInterface.App.Main() in D:\Project\Prodigy\ProdigyUserInterface\Development\WindowUi\obj\Debug\App.g.cs:regel 0
       bij System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       bij System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       bij Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       bij System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       bij System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       bij System.Threading.ThreadHelper.ThreadStart()
    


    It has something to do with CultureInfo. By adding the following line of code to our program (one of the first lines to be executed in our program), the bug is not showing his ugly face anymore:

    Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("en-US", false);

    This is of course NOT the answer to the problem, Microsoft should fix this bug, but for now this is a workaround...
    • Proposed as answer by ddam Wednesday, August 5, 2009 9:14 AM
    Wednesday, August 5, 2009 9:14 AM
  • Hi all,

    Fix is here: http://code.msdn.microsoft.com/KB974373 

    HTH,
    Matt
    SDET : Deployment/Hosting
    Monday, September 28, 2009 11:31 PM
    Moderator
  • Hi,

    it seems this bug is still there in Vista SP2, but it's not possible to install the hotfix on SP2.

    Is there a specific hotfix for SP2 ?

    Jérôme

    Tuesday, September 28, 2010 12:25 PM
  • Is there any update on a fix coming in an official patch and is there a way to get it fixed unofficially in Vista SP2?
    Wednesday, January 19, 2011 9:10 AM