[Version 2.0] BindingFailure and FileNotFound first chance exceptions on startup

Jun 13, 2013 at 10:02 AM
Edited Jun 13, 2013 at 1:42 PM
I just realized it was more relevant to create an issue... sorry...


https://avalondock.codeplex.com/workitem/16261





Hi !

I downloaded this morning the new version (2.0.2000 - changeset 102188).
I updated my source code in order to change the broken "using namespace".

When I launch the debugging session I'm having a BindingFailure exception :
BindingFailure a été détecté
Message: L'assembly avec le nom complet 'Xceed.Wpf.AvalonDock.Aero' n'a pas pu se charger dans le contexte de liaison 'Load' de l'AppDomain ayant l'ID 1.
La cause de l'erreur était : System.IO.FileNotFoundException:
Impossible de charger le fichier ou l'assembly 'Xceed.Wpf.AvalonDock.Aero, Version=2.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4' ou une de ses dépendances.
Le fichier spécifié est introuvable.
Or Google's translation :
BindingFailure was detected
Message: The assembly with the full name 'Xceed.Wpf.AvalonDock.Aero' failed to load in the context of binding 'Load' the AppDomain with ID 1.
The cause of the error was: System.IO.FileNotFoundException:
Could not load file or assembly 'Xceed.Wpf.AvalonDock.Aero, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = 3e4669d2f30244f4' or one of its dependencies.
The specified file was not found.
There is also a bunch on FileNotFoundException :
L'exception System.IO.FileNotFoundException s'est produite
  HResult=-2147024894
  Message=Impossible de charger le fichier ou l'assembly 'Xceed.Wpf.AvalonDock.XmlSerializers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4' ou une de ses dépendances. Le fichier spécifié est introuvable.

Xceed.Wpf.AvalonDock.Layout.Serialization.XmlLayoutSerializer.Deserialize(System.IO.TextReader reader) Ligne 77 C#
Xceed.Wpf.AvalonDock.Layout.Serialization.XmlLayoutSerializer.Deserialize(string filepath) Ligne 107    C#
AvalonDock.MVVMTestApp.MainWindow.MainWindow_Loaded(object sender, System.Windows.RoutedEventArgs e) Ligne 62   C#

Xceed.Wpf.AvalonDock.Layout.LayoutGroup<Xceed.Wpf.AvalonDock.Layout.ILayoutPanelElement>.ReadXml(System.Xml.XmlReader reader) Ligne 219 C#
Xceed.Wpf.AvalonDock.Layout.LayoutPositionableGroup<Xceed.Wpf.AvalonDock.Layout.ILayoutPanelElement>.ReadXml(System.Xml.XmlReader reader) Ligne 297 C#
Xceed.Wpf.AvalonDock.Layout.LayoutPanel.ReadXml(System.Xml.XmlReader reader) Ligne 78   C#
The exception only happens if Visual Studio is told to break on first-chance exceptions (Visual Studio top menu -> Debugging -> Exceptions -> select all or only BindingFailure and FileNotFound)

In order to check if my code was causing the exception, I downloaded the AvalonDock source code and I'm having the same issue after customizing the "break on first chance exceptions" settings.

Not a critical issue but as I launch my debugging sessions with all first-chance exceptions enabled, it is quite annoying ! :)
Jul 31, 2013 at 7:58 AM
I also replied on the issue you created, but I'm copy/pasting it here for convenience of googlers:

I agree this is quite annoying. The problem here is that the themes assembly are wrongly named. Their name are Xceed.Wpf.AvalonDock.Themes.<ThemeName> whereas Windows expects it to be Xceed.Wpf.AvalonDock.<ThemeName>.

Here is how you can fix that locally, if you're okay to rebuild AvalonDock by yourself from the sources:

Edit AssemblyInfo.cs from the AvalonDock project and change the following: (comments removed for sanity)
[assembly: ThemeInfo(
    ResourceDictionaryLocation.SourceAssembly,
    ResourceDictionaryLocation.SourceAssembly
)]
To this:
[assembly: ThemeInfo(
    ResourceDictionaryLocation.None,
    ResourceDictionaryLocation.SourceAssembly
)]
Themes can be specified in the DockingManager.Theme field, and there's no classic theme so it is not a good idea to rely on the existence of a theme assembly anyway.

You might have the following exceptions if you're using metro, expression or visual2010 theme:
"Cannot locate resource 'themes/aero/images/htabgroup.png'."
"Cannot locate resource 'themes/aero/images/vtabgroup.png'."
Just find the references to these images in the themes (Find In Files "themes/aero/images") and replace these paths by "Themes/Generic/Images".

And that's it, no more exceptions!
Aug 13, 2013 at 11:11 AM
Aug 30, 2013 at 12:11 PM
Is it necessarry to compile the AvalonDock-Code. Is it not possible to deactivate Aero.

I've tried to deactivate it with
                            <avalonDock:DockingManager Theme="{x:Null}">
but i still get the Exception.

Is it planned to fix this problem in the next version?