Free Code Snippets in C#, Net Framework, Office 365, ASP.Net,WPF, Visual Studio, SQL Server, Antivirus free
#

Error caused by Caliburn Micro

 

In a download project from Windows 8.1 for the transfer in Windows 10 the error is shown, that there is an internal error to the Caliburnproject and Caliburn.Micro.

The use in the old project can be found in the XAML header

Further testing revealed that Caliburn was installed as a platform-spreading tool, so you could run the application as a Windows App and Phone App.

 

Convert to Windows 10

Do you need the Caliburn?

 

Solution:

You just have to delete the uses and then use the application as a regular WPF.

With Caliburn the application is used as an MVVM application, with a model should be deposited.

For WPF, however, this has not prevailed.

 

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">

 

 

 

 

After rebuilding, the error:

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)

 

 

And the project uses Caliburn.Micro in the bootstrap

 

For what you need 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

 

Solution for this project

Just delete the AppBootstrapper class as a file

 

And in the app.xaml expand the Resource AppBootstrapper.

 

 

The program then runs through

 

 

  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)

 

 

 

A warning is generated under the build of the project

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
»
Error caused by Caliburn Micro
»
WPF: System.Windows.Interactivity is broken or missing
»
WPF Error: An error occurred while signing
»
WPF Registry. DeleteSubKey: System.UnautohorizedAccessException
»
WPF: UserControl.Name does not use hyphen dashes

.

Contact for Jobs, Project Requests: raimund.popp@microsoft-programmierer.de