After cleaning the solution the error with the ChilForm did not come up again. But I got other errors now. The reason for the second error is the BusinessBindingSource (which u referred to), but the first one happened while loading a form without a BBS.
So I checked the Navigated Event and I found out that when the Navigated Event is fired the primary BO is still empty. Thats why the Event Handler for that event did not work, since the contents of it rely on valid data in the primary BO.
Its was not a big deal to change the contents of the Event Handler, but since it worked with the last version I guess u must have changed when the Navigated Event is fired. Running the same thing with the old dlls showed, that the primary BO already was populated when the Event got fired.
Anyways since i changed my code a little it worked now, but maybe you want to look into that, to prevent others from having to go through the same problems.
1.
BusinessLayerException
The CurrentRow could not be evaluated because the CurrentRowIndex is out of range. Business object record count: 0. CurrentRowIndex: -1.
Source : MicroFour StrataFrame Business
Stack Trace:
bei MicroFour.StrataFrame.Business.BusinessLayer.get_CurrentRow()
bei BodoConsult.AssetAllocator.AssetAllocatorBOs.Produkttypen.get_P_ID() in C:\Daten\Projekte\AssetAllocator\AssetAllocatorBOs\MasterData\MasterData\Produkttypen.Designer.cs:Zeile 306.
bei AssetAllocator.Forms.Produkttyp.produkttypen1_Navigated(NavigatedEventArgs e) in C:\Daten\Projekte\AssetAllocator\AssetAllocator\Forms\Produkttyp.cs:Zeile 116.
bei MicroFour.StrataFrame.Business.BusinessLayer.NavigatedEventHandler.Invoke(NavigatedEventArgs e)
bei MicroFour.StrataFrame.Business.BusinessLayer.raise_Navigated(NavigatedEventArgs e)
bei MicroFour.StrataFrame.Business.BusinessLayer.OnNavigated(NavigatedEventArgs e)
bei MicroFour.StrataFrame.Business.BusinessLayer.Navigate(BusinessNavigationDirection Direction, Int32 AbsoluteIndex, Object[] PrimaryKeyValues, Boolean AttemptToCheckRules, Boolean IsRefill)
bei MicroFour.StrataFrame.Business.BusinessLayer.OnCurrentDataTableRefilled()
bei MicroFour.StrataFrame.Business.BusinessLayer.CreateInternalTable()
bei MicroFour.StrataFrame.Business.BusinessLayer.get__CurrentDataTable(Boolean IsSharedTable)
bei MicroFour.StrataFrame.Business.BusinessLayer.get_Count()
bei MicroFour.StrataFrame.UI.Windows.Forms.MaintenanceFormToolStrip.HandleEditingStateChanged(EditingStateChangedEventArgs e)
bei MicroFour.StrataFrame.UI.Windows.Forms.MaintenanceFormToolStrip.InitializeObject()
bei MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.InitializeFormLoadObjects()
bei MicroFour.StrataFrame.UI.Windows.Forms.BaseForm.OnLoad(EventArgs e)
bei System.Windows.Forms.Form.OnCreateControl()
bei System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
bei System.Windows.Forms.Control.CreateControl()
bei System.Windows.Forms.Control.WmShowWindow(Message& m)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.ContainerControl.WndProc(Message& m)
bei System.Windows.Forms.Form.WmShowWindow(Message& m)
bei System.Windows.Forms.Form.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)
bei System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
2.
TargetInvocationException
Ein Aufrufziel hat einen Ausnahmefehler verursacht.
NullReferenceException
Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
Source : mscorlib
Stack Trace:
bei MicroFour.StrataFrame.Business.BusinessBindingSource.BusinessObject_CurrentDataTableRefilled()
bei MicroFour.StrataFrame.Business.BusinessLayer.raise_CurrentDataTableRefilled()
bei MicroFour.StrataFrame.Business.BusinessLayer.OnCurrentDataTableRefilled()
bei MicroFour.StrataFrame.Business.BusinessLayer.CreateInternalTable()
bei MicroFour.StrataFrame.Business.BusinessLayer.get__CurrentDataTable(Boolean IsSharedTable)
bei MicroFour.StrataFrame.Business.BusinessBindingSource.AddBOHandlers()
bei MicroFour.StrataFrame.Business.BusinessBindingSource.set_BusinessObject(BusinessLayer value)
bei AssetAllocator.Forms.Musterportfolios.InitializeComponent() in C:\Daten\Projekte\AssetAllocator\AssetAllocator\Forms\Musterportfolios.Designer.cs:Zeile 1133.
bei AssetAllocator.Forms.Musterportfolios..ctor() in C:\Daten\Projekte\AssetAllocator\AssetAllocator\Forms\Musterportfolios.cs:Zeile 19.
bei System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)
bei System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)
bei System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)
bei System.Activator.CreateInstance(Type type, Boolean nonPublic)
bei System.Activator.CreateInstance(Type type)
bei AssetAllocator.Forms.Main.LaunchForm(Type FormType) in C:\Daten\Projekte\AssetAllocator\AssetAllocator\Forms\Main.cs:Zeile 112.
bei AssetAllocator.Forms.Main.tsmiMusterportfolios_Click(Object sender, EventArgs e) in C:\Daten\Projekte\AssetAllocator\AssetAllocator\Forms\Main.cs:Zeile 218.
bei System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
bei System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
bei System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
bei System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
bei System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
bei System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
bei System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
bei System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
bei System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
bei System.Windows.Forms.Control.WndProc(Message& m)
bei System.Windows.Forms.ScrollableControl.WndProc(Message& m)
bei System.Windows.Forms.ToolStrip.WndProc(Message& m)
bei System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
bei System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)
bei System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)
bei System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)