Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid cast when opening TabControlVisualizer #29

Open
PathogenDavid opened this issue Jul 4, 2024 · 0 comments
Open

Invalid cast when opening TabControlVisualizer #29

PathogenDavid opened this issue Jul 4, 2024 · 0 comments

Comments

@PathogenDavid
Copy link
Member

PathogenDavid commented Jul 4, 2024

Noticed while reproducing bonsai-rx/bonsai#1875

Unclear if this is Bonsai or Bonsai.Gui, but the crash is in Bonsai.Gui so filing here.

  1. Download src.zip and open it in Bonsai
  2. Start the workflow
  3. Show the TabControlVisualizer for the "Animal test @ Task AindVr Foraging" node in the Workflow tab (not the OperationControl tab)

Bonsai crashes with the following exception. (If you swap the order of 3 and 2 it also fails, but it ends up down the bonsai-rx/bonsai#1796 path and two exception dialogs appear instead)

System.InvalidCastException
  HResult=0x80004002
  Message=Unable to cast object of type 'Bonsai.Expressions.GroupWorkflowBuilder' to type 'Bonsai.Gui.TableLayoutPanelBuilder'.
  Source=Bonsai.Gui
  StackTrace:
   at Bonsai.Gui.MashupControlVisualizerBase`2.Load(IServiceProvider provider) in Bonsai.Gui\MashupControlVisualizerBase.cs:line 52
   at Bonsai.Gui.ContainerControlVisualizerBase`2.LoadMashupSource(Int32 index, MashupSource mashupSource, IServiceProvider provider) in Bonsai.Gui\ContainerControlVisualizerBase.cs:line 39
   at Bonsai.Gui.MashupControlVisualizerBase`2.LoadMashups(IServiceProvider provider) in Bonsai.Gui\MashupControlVisualizerBase.cs:line 61
   at Bonsai.Design.MashupVisualizer.Load(IServiceProvider provider) in ...\bonsai\Bonsai.Design\MashupVisualizer.cs:line 30
   at Bonsai.Gui.MashupControlVisualizerBase`2.Load(IServiceProvider provider) in Bonsai.Gui\MashupControlVisualizerBase.cs:line 57
   at Bonsai.Design.VisualizerDialogLauncher.InitializeComponents(TypeVisualizerDialog visualizerDialog, IServiceProvider provider) in ...\bonsai\Bonsai.Editor\Layout\VisualizerDialogLauncher.cs:line 59
   at Bonsai.Design.DialogLauncher.Show(IWin32Window owner, IServiceProvider provider) in ...\bonsai\Bonsai.Editor\Layout\DialogLauncher.cs:line 57
   at Bonsai.Editor.GraphView.WorkflowGraphView.<>c__DisplayClass153_0.<CreateVisualizerMenuItem>b__0(Object <p0>, EventArgs <p1>) in ...\bonsai\Bonsai.Editor\GraphView\WorkflowGraphView.cs:line 1752
   at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at Bonsai.Launcher.LaunchWorkflowEditor(PackageConfiguration packageConfiguration, ScriptExtensions scriptExtensions, String editorRepositoryPath, String initialFileName, Single editorScale, Boolean start, Boolean debugging, Dictionary`2 propertyAssignments) in ...\bonsai\Bonsai\Launcher.cs:line 107
   at Bonsai.Program.Main(String[] args) in ...\bonsai\Bonsai\Program.cs:line 160
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant