#

Fehler durch Caliburn Micro

 

In einem Download Projekt aus Windows 8.1 für die Übernahme in Windows 10 wird der Fehler angezeigt, dass ein interner Fehler zur Caliburnproject und Caliburn.Micro besteht.

Die Verwendung im alten Projekt findet man im XAML Header wieder

Unter weiterer Prüfung zeigte sich, dass Caliburn als Platformübergreifendes Tool eingebaut wurde, damit man die Anwendung als Windows App und Phone App ausführen können wollte.

 

Umwandung in Windows 10

Benötig man die Caliburn Einbindungen ?

 

Lösung:

Man muss einfach die Verwendungen löschen und die Anwendung dann als reguläre WPF vewerden.

Mit Caliburn wird die Anwendung als MVVM Anwendung verwendet, wobei ein Model hinterlegt sein sollte.

Für WPF hat sich dieses allerdings nicht durchgesetzt.

 

Caliburn.Micro.Message

<Window x:Class="ScreenCaptureWrapper.ShellView"

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        xmlns:cal="http://www.caliburnproject.org"

        Title="ScreenCaptureWrapper" Height="420" Width="420" Icon="Images/screen-capture-wrapper.png"

        Background="#eee"

        cal:Message.Attach="[Event Closed] = [Action OnClosed()]">

    <DockPanel Margin="10">

 

 

 

 

Nach dem erneuten Build Erstellen komm der Fehler:

System.TypeInitializationException occurred

  HResult=0x80131534

  Message=Der Typeninitialisierer für "Caliburn.Micro.Message" hat eine Ausnahme verursacht.

  Source=<Cannot evaluate the exception source>

 

  StackTrace:..

 

Inner Exception 1:

FileLoadException: Die Datei oder Assembly "System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040)

 

 

Und das Projekt verwendet Caliburn.Micro im Bootstraper

 

Wofür benötigt man Caliburn.Micro in WPF

http://caliburnmicro.com/

A small, yet powerful framework, designed for building applications across all XAML platforms. Its strong support for MV* patterns will enable you to build your solution quickly, without the need to sacrifice code quality or testability

 

Lösung für dieses Projekt

Einfach die Klasse AppBootstrapper löschen als Datei

 

Und in der app.xaml die Resource AppBootstrapper ausbauen.

 

 

Anschliessend läuft das  Programm durch

 

 

  StackTrace:

   at Caliburn.Micro.Message.SetHandler(DependencyObject d, Object value)

   at Caliburn.Micro.Action.SetTargetCore(DependencyPropertyChangedEventArgs e, DependencyObject d, Boolean setContext)

   at Caliburn.Micro.Action.OnTargetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)

   at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)

   at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)

   at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)

   at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)

   at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)

   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)

   at Caliburn.Micro.ViewModelBinder.<.cctor>b__3(Object viewModel, DependencyObject view, Object context)

   at Caliburn.Micro.WindowManager.CreateWindow(Object rootModel, Boolean isDialog, Object context, IDictionary`2 settings)

   at Caliburn.Micro.WindowManager.ShowWindow(Object rootModel, Object context, IDictionary`2 settings)

   at Caliburn.Micro.BootstrapperBase.DisplayRootViewFor(Type viewModelType, IDictionary`2 settings)

   at Caliburn.Micro.BootstrapperBase.DisplayRootViewFor[TViewModel](IDictionary`2 settings)

   at ScreenCaptureWrapper.AppBootstrapper.OnStartup(Object sender, StartupEventArgs e) in C:\_Daten\Desktop\WinForms\_test\ScreenCaptureWrapper-master\ScreenCaptureWrapper\AppBootstrapper.cs:line 46

   at System.Windows.Application.OnStartup(StartupEventArgs e)

   at System.Windows.Application.<.ctor>b__1_0(Object unused)

   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)

   at System.Windows.Threading.DispatcherOperation.InvokeImpl()

   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(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 MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)

   at System.Windows.Threading.DispatcherOperation.Invoke()

   at System.Windows.Threading.Dispatcher.ProcessQueue()

   at System.Windows.Threading.Dispatcher.WndProcHook(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 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, 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 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)

   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)

   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)

   at System.Windows.Application.RunDispatcher(Object ignore)

   at System.Windows.Application.RunInternal(Window window)

   at System.Windows.Application.Run(Window window)

   at System.Windows.Application.Run()

   at ScreenCaptureWrapper.App.Main()

 

Inner Exception 1:

FileLoadException: Die Datei oder Assembly "System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040)

 

 

 

Unter dem Build des Projekts wird eine Warnung erzeugt

Found conflicts between different versions of the same dependent assembly that could not be resolved. 

These reference conflicts are listed in the build log when log verbosity is set to detailed.

 

 

Severity

Code

Description

Warning

 

Found conflicts between different versions of the same dependent assembly that could not be resolved.  These reference conflicts are listed in the build log when log verbosity is set to detailed.

 

 

 

System.Windows.Markup.XamlParseException occurred

  HResult=0x80131501

  Message=Der Typeninitialisierer für "Caliburn.Micro.Message" hat eine Ausnahme verursacht.

  Source=PresentationFramework

  StackTrace:

   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)

 

Inner Exception 1:

FileLoadException: Die Datei oder Assembly "System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040)

 

Mobile

.