MEF bootstrapper exception CM 1.3

Topics: Bootstrappers & IoC
Jan 24, 2012 at 3:57 PM

With CM 1.3 I get the following exception when trying to design xaml-view (with 1.2 everything is fine):

ArgumentNullExceptionwas thrown by Bootstrapper...

at Caliburn.Micro.Bootstrapper.StartDesignTime() in C:\Projects\Blue Spire\Caliburn.Micro\src\Caliburn.Micro.Silverlight\Bootstrapper.cs:line 49 at Caliburn.Micro.Bootstrapper`1..ctor()...

 In my Configure() method I just do

var catalog = new AggregateCatalog(
             SelectAssemblies().Select( x => new AssemblyCatalog( x ) ).OfType<ComposablePartCatalog>()

and so on...

Application is running, only design time seems to be failing 

Jan 24, 2012 at 5:03 PM

Is this by chance a Silverlight 5 project?

Jan 25, 2012 at 10:13 AM

No SL4. And I took the dll's contained in Caliburn.Micro v1.3 RTW\bin\Silverlight\Release folder

Jan 25, 2012 at 2:31 PM

Do you have SL5 installed or the new version of Blend? The reason I'm asking is that there is some bug in SL5/Blend that causes design-time exceptions with MEF and I think it causes it as long as those things are installed. I'm not 100% sure. If you can create a simple solution that reproduces the problem and send that to me with steps to reproduce, I can have a look at it.

Jan 25, 2012 at 8:04 PM
Edited Jan 25, 2012 at 8:18 PM

No SL 5 installed. No Blend. I willsend you a test project with a screenshot of the error (error.png). Just open solution, open ShellView.xaml and click in xaml region, then click on design region. The error should appear (just try a few times).

Created new work item #202 with included and same title as this post. Hope this was correct.

Jan 27, 2012 at 9:23 PM

I'm seeing those errors with SL5.

Jan 27, 2012 at 9:29 PM

There are known issues with SL5 design-time due to bugs in Silverlight. I don't know if this is that or something else. I'll investigate as soon as I the mean time....pull requests (esp. for bug fixes) are usually honored ;)

Jan 30, 2012 at 7:19 AM

Just for information: I have the same ArgumentNullException in a WPF XBAP Application, when opening a view for editing (i.e. ShellView). In RTW 1.2 there was no error.

Jan 30, 2012 at 3:01 PM

Ok. I think I know what the problem is.

Jan 31, 2012 at 7:12 PM

I've committed code that I think will fix this. If you have a chance, please try it out. I'm going to try to release v1.3.1 today if I can.

Feb 1, 2012 at 7:33 AM

It's working. Thanks.

Feb 1, 2012 at 8:11 PM
Edited Feb 1, 2012 at 8:24 PM


Feb 1, 2012 at 8:26 PM

The design time stuff that use to work in Blend 4, doesn't work now.  I do have SL5 installed and the Blend 5 preview.

Feb 1, 2012 at 8:32 PM

That may be why. There is a bunch of design-time stuff that broke because of Silverlight 5. I saw reports on the Silverlight insiders lists of various commercial products having these issues. The issues even cause SL4 to break if you have SL5 installed.

Feb 2, 2012 at 4:36 AM

Before the 1.3.1 change I use to have to do this to get DD working:

        protected override IEnumerable<Assembly> SelectAssemblies()
            return Execute.InDesignMode ? new[] { typeof(MainPageViewModel).Assembly } : base.SelectAssemblies();

Hopefully there will be a Blend 5 soon, it's annoying not having design data in Blend, well, I don't mind but the designer I work with does.