gemini icon indicating copy to clipboard operation
gemini copied to clipboard

Gemini.Demo crashes when selecting View Error List or View Output

Open matthewclendening opened this issue 9 years ago • 8 comments

The crash is in LayoutInitializer.cs: CreateAnchorablePane (line 63): InvalidOperationException: Sequence contains no matching element

Seems to be assuming there exists a current panel with the specified orientation - which is not the case.

matthewclendening avatar Sep 12 '15 15:09 matthewclendening

I can't repro this. Please can you try these steps:

  1. Delete ApplicationState.bin in Gemini.Demo/bin/Debug.
  2. Try again.

If you don't get the crash after resetting the state file, then please could you find a minimal set of repro steps to get the crash? I'm pretty sure the crash is related to the workaround I mentioned in #25.

Unfortunately the Extended WPF Toolkit, which AvalonDock is now part of, is on an extremely slow release cycle, so even though the original bug was fixed months ago in the commercial edition, it hasn't propagated to the free edition yet.

tgjones avatar Sep 13 '15 04:09 tgjones

I suggest to integrate own patched version of AvalonDock or use Sony ATF framework docking system, see https://github.com/SonyWWS/ATF/tree/master/Framework/Atf.Gui.Wpf/Docking

amerkoleci avatar Sep 13 '15 20:09 amerkoleci

Sorry - I'm away from my main desktop for a week. Just re-cloned it on a new machine and it does work fine. I'll see if I can recreate it :)

matthewclendening avatar Sep 14 '15 00:09 matthewclendening

Can we please try to fix this issue?

amerkoleci avatar Sep 21 '15 12:09 amerkoleci

I can't reproduce it. @matthewclendening is going to try on his computer.

tgjones avatar Sep 21 '15 12:09 tgjones

I too cannot "simply" reproduce. What do I mean by that?

Opening the Error List yields no exceptions.

I open the Helix document, and, still no exceptions.

I type gibberish in the code window, and it successfully lists errors, warnings, etc.

However, I double click one of those errors, and that's an exception:

protected override object GetInstance(Type serviceType, string key)
{
    string contract = string.IsNullOrEmpty(key) ? AttributedModelServices.GetContractName(serviceType) : key;
    var exports = Container.GetExports<object>(contract);

    if (exports.Any())
        return exports.First().Value;

    throw new Exception(string.Format("Could not locate any instances of contract {0}.", contract));
}

Exception:

System.ArgumentNullException occurred
  HResult=-2147467261
  Message=Value cannot be null.
Parameter name: type
  Source=System.ComponentModel.Composition
  ParamName=type
  StackTrace:
       at System.ComponentModel.Composition.AttributedModelServices.GetContractName(Type type)
       at Gemini.AppBootstrapper.GetInstance(Type serviceType, String key) in d:\Source\Spikes\Gemini\gemini\src\Gemini\AppBootstrapper.cs:line 78
  InnerException: 

HTH

mwpowellhtx avatar Sep 21 '15 14:09 mwpowellhtx

Sorry all, I was out all last week. I've not been able to repro this either. I'm guessing it may be due to the way I was building up the UI by adding tool windows over time (programmatically). I was experimenting to see if I could get a default docked layout in a certain configuration - essentially with two tool windows both docked on the right - one above the other. I never was able to see how to do this programmatically. Of course - when you do it visually with the mouse and exit the app - the docking state is nicely serialized. Does anyone know if there is an existing fine-grained way to configure the docking layout - in code?

matthewclendening avatar Sep 21 '15 22:09 matthewclendening

I also have faced this bug. It can be reproduced by following steps on Gemini.Demo:

  1. Delete ApplicationState.bin in Gemini.Demo/bin/Debug i
  2. Run Demo
  3. Drag Inspector pane from right to left
  4. Run View->Output

After this actions Demo crashes:

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Sequence contains no matching element at System.Linq.Enumerable.First[TSource](IEnumerable1 source, Func2 predicate) at Gemini.Modules.Shell.Controls.LayoutInitializer.CreateAnchorablePane(LayoutRoot layout, Orientation orientation, String paneName, InsertPosition position) at Gemini.Modules.Shell.Controls.LayoutInitializer.BeforeInsertAnchorable(LayoutRoot layout, LayoutAnchorable anchorableToShow, ILayoutContainer destinationContainer) at Xceed.Wpf.AvalonDock.DockingManager.anchorablesSourceElementsChanged(Object sender, NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ObservableCollection1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at Caliburn.Micro.BindableCollection1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ObservableCollection1.InsertItem(Int32 index, T item) at Caliburn.Micro.BindableCollection1.InsertItemBase(Int32 index, T item) at Caliburn.Micro.BindableCollection1.<>c__DisplayClass5.<InsertItem>b__4() at Caliburn.Micro.XamlPlatformProvider.OnUIThread(Action action) at Caliburn.Micro.BindableCollection1.InsertItem(Int32 index, T item) at System.Collections.ObjectModel.Collection`1.Add(T item) at Gemini.Modules.Shell.ViewModels.ShellViewModel.ShowTool(ITool model)

I have debug this issue but have find solution yet. The problem is that after Inspector was dragged to left VerticalPanel LayoutPanel has Orientation=Horizontal

I am not very familiar with AvalonDock and appreciate any advise how to fix this.

vasiliy-vdovichenko avatar Jul 15 '16 16:07 vasiliy-vdovichenko