Search code examples
wpfcaliburn.micro

NullReferenceException occurred in Caliburn.Micro.dll


I have a WPF Caliburn.Micro application. Here is a part of my code:

  protected override void OnViewLoaded( object view )
  {
     base.OnViewLoaded( view );

     var firstDataEntryVM = new FirstDataEntryViewModel();
     ActivateItem(firstDataEntryVM);

This causes

A first chance exception of type 'System.NullReferenceException' occurred in Caliburn.Micro.dll

Here is the call stack:

enter image description here

I downloaded source code of Caliburn.Micro.WPF and added it to the solution. But now I cannot run the application at all:

enter image description here

How can I debug it?


Solution

  • A couple of ways come to mind:

    • Do you have the source code where the error is happening (I haven't looked to see if Caliburn is open source)?
    • Decompile the code and recompile it into a project using a decompiler such as Just Decompile.
    • Intellitrace can give you some additional information.

    EDIT The source code for this project is available at CodePlex. Download the code and debug from Visual Studio!