Instructions & Downloads for Caliburn Micro 1.1 RTW .net 3.5 WPF Compilation

Update: Caliburn.Micro 1.1 has been released (RTW) and if you are living in .net framework 3.5 Sp1 land these instructions show how to compile Caliburn.Micro 1.1 RTW against the .Net framework 3.5 SP1 runtime.

Instructions how to compile Caliburn.Micro 1.1 for .net framework 3.5 and WPF

  1. First things first – you can skip these instructions and simply download Caliburn.Micro 1.1 RTW .net 3.5 assemblies.
  2. Otherwise to get started download the Caliburn.Micro .net 4.0 source.
  3. Copy the visual studio 2010 solution files into a working directory
    Caliburn.Micro Source Code Files
  4. Open the solution file (ignore projects not loading message).Microsoft Visual Studio Projects not loaded correctly
  5. Generally the windows phone 7 project will not load
    (unless you have WP7 SDK)Caliburn.Micro VS Solution
  6. Remove the WP7 & Silverlight Projects from the solution Caliburn.Micro WPF Project Files
    (don’t delete the Silverlight files as they are referenced by WPF)
  7. Change the project to target the .net 3.5 runtime . Target .net 3.5 Framework(client profile is optional depending on your needs)
  8. Remove the existing reference to System.Windows.Interactivity and System.Xaml
    System.Windows.Interactivity Caliburn
  9. Download System.Windows.Interactivity assembly dll for .net 3.5 from one of the following sources:
  10. Add a reference to System.Windows.Interactivity.dll assembly.
  11. Download System.CoreEx assembly dll for .net 3.5 from one of the following sources:
  12. Add a reference to the System.CoreEx.dll assembly.
  13. Compiling the solution will throw an error: Invalid variance: The type parameter 'T' must be invariantly valid on 'Caliburn.Micro.IParent<T>.GetChildren()'. 'T' is covariant.
    • To correct this error change line 26 of IConductor.cs to remove the ‘out’ modifier
    • IConductor.cs IParent Error
    • The updated code will look as follows:IConductor.cs IParent Fixed
  14. Compiling will throw another error: type or namespace name 'DatePicker' could not be found
    • There are two options to correct this:
    • Add a reference to the WPF Toolkit.
    • Remove the conditional from line 182 of ConventionManager.cs ConventionManager DatePicker AddElementConvention
  15. Compiling will throw one final error: ActionMessage.cs 'System.Array' does not contain a definition for 'Zip'...
    • The following code will fix the error and get Caliburn.Micro 1.1 to compile under .Net 3.5
    • You can download the EnumerableExtension.cs source file or copy the code below.

    • static class EnumerableExtension
      {
      public static IEnumerable<TResult> Zip<T1, T2, TResult>(this
      IEnumerable<T1> source1, IEnumerable<T2> source2, Func<T1, T2,
      TResult> func)
      {
      using (var iter1 = source1.GetEnumerator())
      using (var iter2 = source2.GetEnumerator())
      {
      while (iter1.MoveNext() && iter2.MoveNext())
      {
      yield return func(iter1.Current, iter2.Current);
      }
      }
      }
      }

If all was followed correctly you will have a copy of the Caliburn.Micro 1.1 RTW source code building against the .net framework 3.5. If you have any questions please comment and I will replay asap. Of course you can always download the compiled Caliburn.Micro 3.5 assemblies directly.