Application crashes if scanned assemblies are duplicated
See original GitHub issueWe have a plugin model that discovers view/viewmodels from external assemblies. If by mistake the assemblies are copied twice (to different discovery locations), the application would blow up with the following stack trace.
The SelectedAssemblies()
method uses assemblies where as underlying cache which is the cause of the problem uses the Type name as the key.
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 Caliburn.Micro.EnumerableExtensions.Apply[T](IEnumerable`1 enumerable, Action`1 action)
at Caliburn.Micro.AssemblySourceCache.<>c.<Install>b__3_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.OnUIThread(Action action)
at Caliburn.Micro.BootstrapperBase.StartRuntime()
at Caliburn.Micro.BootstrapperBase.Initialize()
at ServiceInsight.Startup.AppBootstrapper..ctor() in /_/src/ServiceInsight/Startup/AppBootstrapper.cs:line 41
A simple fix would be to not add duplicate items to the cache if they already exist.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
WPF ARM64 app crashes on startup, unless assemblies ...
So, I decided to export as self-contained + not as single file, to be able to scan all assemblies. I simply add a...
Read more >Scanning application crashes upon close after you perform ...
This issue occurs because, when the scanning application performs a scan, the callbacks that were registered are not released until the scanning application...
Read more >Windows Explorer crashes when opening folder with a ...
After installing VS17 Update 1, I can no longer open any folder with a Typescript file in it in Windows Explorer (Windows 10)....
Read more >Software Crashes before the Viewport Is Displayed When ...
When launching BuildIT, the splash screen is shown (or not) and the software crashes before showing the BuildIT interface.
Read more >App crashes when trying to duplicate layer
When I use the Smart Selection tool with or without refining the selection, if I try to duplicate the selection, the app crashes....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@HEskandari thanks for the PR
@KasperSK Raised a PR with a failing test and the fix.