MahApps.Metro: Missing method exception using 1.1.3-Alpha

Hi,

I’ve set up a sample project to try the new DialogCoordinator functionality of the next version of mahapps.metro. It works very well on my virtual machine that has windows 8.1 and VS 2013 community.

On my work machine, it compiles fine, but throws a runtime error during the initialization of the main window. I will include the stacktrace below, although I apologize my work machine is localized in french and is locked down administratively. Hopefully it will still help. The OS is windows 7 Ultimate 64-bit and I have VS 2012 pro.

From the inner exception, it’s like it cannot find a method from mscorlib. I have verified while running, and the assembly is loaded correctly from the GAC at runtime…

The interesting thing is that everything works fine with the latest stable build from Nuget (1.1.2) if I comment out the new functionality from my code.

Thank you for any insight!

L’exception System.Windows.Markup.XamlParseException s’est produite HResult=-2146233087 Message=‘L’initialisation de ‘PrismDemo.Views.MainWindow’ a levé une exception.’ numéro de ligne ‘28’ et position de ligne ‘7’. Source=PresentationFramework LineNumber=28 LinePosition=7 StackTrace: à System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri) à System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri) à System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) à System.Windows.Application.LoadComponent(Object component, Uri resourceLocator) à PrismDemo.Views.MainWindow.InitializeComponent() dans c:\Document\Projets\PrismMVVMTemplate\PrismDemo\Views\MainWindow.xaml:ligne 1 à PrismDemo.Views.MainWindow…ctor() dans c:\Document\Projets\PrismMVVMTemplate\PrismDemo\Views\MainWindow.xaml.cs:ligne 12 InnerException: System.MissingMethodException HResult=-2146233069 Message=Méthode introuvable : ‘Void System.Runtime.InteropServices.Marshal.StructureToPtr(!!0, IntPtr, Boolean)’. Source=MahApps.Metro StackTrace: à Microsoft.Windows.Shell.SystemParameters2._InitializeCaptionButtonLocation() à Microsoft.Windows.Shell.SystemParameters2…ctor() à Microsoft.Windows.Shell.SystemParameters2.get_Current() à Microsoft.Windows.Shell.WindowChrome…ctor() à MahApps.Metro.Behaviours.BorderlessWindowBehavior.OnAttached() à System.Windows.Interactivity.Behavior.Attach(DependencyObject dependencyObject) à System.Windows.Interactivity.BehaviorCollection.ItemAdded(Behavior item) à System.Windows.Interactivity.AttachableCollection1.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e) à System.Windows.FreezableCollection1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) à System.Windows.FreezableCollection1.OnCollectionChanged(NotifyCollectionChangedAction action, Int32 oldIndex, T oldValue, Int32 newIndex, T newValue) à System.Windows.FreezableCollection1.AddHelper(T value) à System.Windows.FreezableCollection1.Add(T value) à MahApps.Metro.Behaviours.StylizedBehaviors.OnPropertyChanged(DependencyObject dpo, DependencyPropertyChangedEventArgs e) à System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) à System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) à System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) à System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType) à System.Windows.StyleHelper.ApplyStyleOrTemplateValue(FrameworkObject fo, DependencyProperty dp) à System.Windows.StyleHelper.InvalidateContainerDependents(DependencyObject container, FrugalStructList1& exclusionContainerDependents, FrugalStructList1& oldContainerDependents, FrugalStructList1& newContainerDependents) à System.Windows.StyleHelper.DoThemeStyleInvalidations(FrameworkElement fe, FrameworkContentElement fce, Style oldThemeStyle, Style newThemeStyle, Style style) à System.Windows.StyleHelper.UpdateThemeStyleCache(FrameworkElement fe, FrameworkContentElement fce, Style oldThemeStyle, Style newThemeStyle, Style& themeStyleCache) à System.Windows.FrameworkElement.OnThemeStyleChanged(DependencyObject d, Object oldValue, Object newValue) à System.Windows.StyleHelper.GetThemeStyle(FrameworkElement fe, FrameworkContentElement fce) à System.Windows.FrameworkElement.UpdateThemeStyleProperty() à System.Windows.FrameworkElement.OnInitialized(EventArgs e) à System.Windows.FrameworkElement.TryFireInitialized() à System.Windows.FrameworkElement.EndInit() à MS.Internal.Xaml.Runtime.ClrObjectRuntime.InitializationGuard(XamlType xamlType, Object obj, Boolean begin) InnerException:

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Reactions: 1
  • Comments: 31 (15 by maintainers)

Most upvoted comments

I was able to fix a similar problem (NET4 application would crash on NET4 machines with XamlParseException but work fine on NET 4.5.2 machines) by compiling the NET4 MahApps.Metro.dll myself instead of using the official Nuget one.