question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Working with multiple bootstrappers

See original GitHub issue

I have an system consisting of toolbar and multiple tools. Every tool is a separate application provided as a set of dll files. During startup system seeks for libraries containing bootstrappers and registers then as icons on toolbar. These applications can be delivered independently and can be run simultaneously.

After upgrade from Caliburn.Micro 1.5.2 to 2.0.2 a problem appeared. When I start application for the first time everything goes fine. However when I start it again from the toolbar it crashes on load with an exception.

System.ArgumentException: An item with the same key has already been added.
   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at Caliburn.Micro.AssemblySourceCache.<Install>b__4(Type t)
   at Caliburn.Micro.EnumerableExtensions.Apply[T](IEnumerable`1 enumerable, Action`1 action)
   at Caliburn.Micro.AssemblySourceCache.<Install>b__0(Object s, NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Caliburn.Micro.BindableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Caliburn.Micro.BindableCollection`1.<>c__DisplayClasse.<AddRange>b__d()
   at Caliburn.Micro.XamlPlatformProvider.OnUIThread(Action action)
   at Caliburn.Micro.BindableCollection`1.AddRange(IEnumerable`1 items)
   at Caliburn.Micro.BootstrapperBase.StartRuntime()
   at Caliburn.Micro.BootstrapperBase.Initialize()
   at DemoApp.Starter.DemoUIStarter.Start()
   at ...

What is the way to solve this issue? Is there any solution to run applications with multiple bootstrappers safely?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
aplochercommented, Jul 22, 2017

I began getting this exception, but after reading this post I remembered that I commented out some old code (to see if it was still needed) but forgot about it, because I was only testing with one bootstrapper for the longest time. Once I tried a second one (weeks later) I ran into this. Uncommented my old code (below) and works great again lol.

protected override IEnumerable<Assembly> SelectAssemblies()
{
    //http://www.andyrace.com/2014/05/caliburn-micro-and-usercontrols.html
    return base.SelectAssemblies().Where(x => !AssemblySource.Instance.Contains(x));
}

Thank you

0reactions
nigel-sampsoncommented, Sep 3, 2017

@aplocher nice simple fix, thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

.net - General-purpose bootstrappers for chaining multiple " ...
NET4 installer used the code that became Burn and I'm pretty sure the main guy on the WiX/Burn project is working for the...
Read more >
Multiple samples vs. bootstrapping - Cross Validated
You may have a confused understanding of the differences between bootstraps, the interpretation of frequentist statistics, and stratified ...
Read more >
030 TFHE functional bootstrapping over multiple inputs
About the speaker Pierre-Emmanuel Clet is a Phd student working at CEA. ... of functional bootstrapping to compute multi inputs functions.
Read more >
Bootstrapping Multiple Regression Parameters in Python
As a data scientist or software engineer, it's common to work with datasets that require multiple regression analysis.
Read more >
Bootstrapping multiple systems estimates to account for ...
Multiple systems estimation is a standard approach to quantifying hidden populations where data sources are based on lists of known cases. A ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found