The given key was not present in the dictionary error


Author
Message
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
For what it's worth, I just updated to 1.6.7. I was testing a window for an entirely different reason and received the same error mentioned above. I am getting the error on other windows that have the DevEx Grid, too. Has this been resolved? Is there an easy fix to it all?



I have several updates ready to be released, but I am on hold because of this issue.



Thanks,

Bill
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
Here are the exception details (if they help):



System.Collections.Generic.KeyNotFoundException was unhandled by user code

Message="The given key was not present in the dictionary."

Source="mscorlib"

StackTrace:

at System.ThrowHelper.ThrowKeyNotFoundException()

at System.Collections.Generic.Dictionary`2.get_Item(TKey key)

at MicroFour.StrataFrame.Business.BusinessLayer.get__CurrentDataTable(Boolean IsSharedTable)

at MicroFour.StrataFrame.Business.BusinessBindingSource.RemoveBOHandlers()

at MicroFour.StrataFrame.Business.BusinessBindingSource.Dispose(Boolean disposing)

at System.ComponentModel.Component.Dispose()

at System.ComponentModel.Container.Dispose(Boolean disposing)

at System.ComponentModel.Container.Dispose()

at Aspire.Production.ProductionRequirements.Dispose(Boolean disposing) in C:\Aspire Projects\AspireSF\Production\ProductionRequirements.Designer.cs:line 18

at System.ComponentModel.Component.Dispose()

at System.Windows.Forms.Form.WmClose(Message& m)

at System.Windows.Forms.Form.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)

at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

InnerException:
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
A bit more info...I blew away the BOs on a specific window that was generating this error. I replaced them with a DataSet generated by a stored procedure. The window works great. No error. So, the conclusion is that the BOs have something different about them that is causing this error to occur. I will try to rebuild all of the BOs in the BOM; however, I did this already. Maybe something didn't stick properly.
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
Since I have only one major active project at the moment, I decided to uninstall all DevExpress versions and reinstall the latest version, 9.1.5. The installation went without a hitch. I ran the conversion tool on my project and I edited the Inherited UI project. It built with no errors. I then went into my Subclass project and updated its references to the new DevEx version. It rebuilt without incident (after deleting the licenses.licx file). Then, I rebuilt my main project. I ran it...opened a window with a DevEx grid filled by a sproc (no BOs) and it closes without any problem. I open a window with a DevEx grid filled via a BBS and a BO and the data looks good; however, when I close it, I still get the same KeyNotFoundException.



So, reinstalling and upgrading the DevEx controls did not solve the problem. Next, I will uninstall the StrataFrame application and try reinstalling the most recent version, 1.6.7.



(fingers crossed)
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
1.6.7 was available. I hit the link to download, but I left the window open too long so my session timed out. I logged back on and 1.6.7 was gone. 1.7.0 has been released. Ok. Cool. I downloaded it and the source code. Installed both. Updated the Inherited UI with DevEx 9.1.5. Rebuilt all business objects. Ran the application and



WHAM!



Same error.



Message: The given key was not present in the dictionary.



Source: mscorlib



Inner Exception:



Stack Trace: at System.ThrowHelper.ThrowKeyNotFoundException()

at System.Collections.Generic.Dictionary`2.get_Item(TKey key)

at MicroFour.StrataFrame.Business.BusinessLayer.SharedDataTableCollection.get_Item(String SharedTableKey)

at MicroFour.StrataFrame.Business.BusinessLayer.get__CurrentDataTable(Boolean IsSharedTable)

at MicroFour.StrataFrame.Business.BusinessLayer.get__CurrentDataTable()

at MicroFour.StrataFrame.Business.BusinessLayer.get_CurrentView()

at MicroFour.StrataFrame.Business.BusinessBindingSource.RemoveBOHandlers()

at MicroFour.StrataFrame.Business.BusinessBindingSource.Dispose(Boolean disposing)

at System.ComponentModel.Component.Dispose()

at System.ComponentModel.Container.Dispose(Boolean disposing)

at System.ComponentModel.Container.Dispose()

at Aspire.Production.InventoryAdjustments.Dispose(Boolean disposing) in C:\Aspire Projects\AspireSF\Production\InventoryAdjustments.Designer.cs:line 12



at System.ComponentModel.Component.Dispose()

at System.Windows.Forms.Form.WmClose(Message& m)

at System.Windows.Forms.Form.WndProc(Message& m)

at System.Windows.Forms.Control.ControlNativewindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativewindow.WndProc(Message& m)

at System.Windows.Forms.Nativewindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)



I am now going on two days trying to fix this. Does anyone have any idea how to repair this problem? Other than getting rid of all Business Binding Sources?!?



Thanks!

Bill



P.S. I am actually getting a bit desperate. My manager is quite annoyed that I spent two full days trying to repair this issue. I have some serious updates to release, but I am stuck. Should I go back to 1.6.6?
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
I opened the source code in VS2008 and built the solution. No errors.

I ran the application and I am still getting the same error.



The dispose override looks like this:



Protected Overrides Sub Dispose(ByVal disposing As Boolean)

'-- Dispose of the internal list of business objects when done and clear

' the references to the pieces

If disposing Then

If Me._BusinessObjectList IsNot Nothing Then

For Each bo As BusinessLayer In Me._BusinessObjectList.Values

bo.Dispose()

Next

Me._BusinessObjectList.Clear()

End If



'-- Remove the reference to the business object

If Me._BusinessObject IsNot Nothing Then

Me.RemoveBOHandlers()

Me._BusinessObject = Nothing

Me._BusinessObject_CurrentView = Nothing

End If

End If



'-- Base call

MyBase.Dispose(disposing)

End Sub




Should I just add a try/catch block and handle the exception myself? I am running totally out of ideas on this.
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
I decided to edit one of the offending windows: Inventory Adjustments. When I opened the form in the designer I got this error:



Object of type 'Aspire.Model.InventoryTransactionsBO' cannot be converted to type 'MicroFour.StrataFrame.Business.BusinessLayer'.



All three BOs on the form kicked out the same error.



So, I took a look at the BO. It's class is defined as follows:



public partial class InventoryTransactionsBO : MicroFour.StrataFrame.Business.BusinessLayer




All looks well there. I have done the rebuild all in the BOM (several times). I will do it again; however, I am suspecting it will do nothing to change things. Also, I will exit VS2008 and start again. Sometimes, that can be a help.



I'll keep at it.
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Bill,



Sorry for the delay here, we have been fighting some internal ISP issues and trying to get the 1.7 build out the door, so a few things fell between the cracks...so BIG apology on this! Blush



OK, is it possible to create a small sample that you can send me so I can see what you are fighting here? It is possible that the DevEx grid is doing something odd (would not be the first time) but I would like to see if it can be reproduced using a standard DataGridView as I would imagine that the issue you are fighting is not related to the DevEx grid but rather instantiation or something along those lines.



A sample, if possible, would drastically move time to the left on this. Thanks!
Bill Cunnien
Bill Cunnien
StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)StrataFrame VIP (1.1K reputation)
Group: Forum Members
Posts: 785, Visits: 3.6K
Hi Trent,



I figured you were busy wrapping up the release. A LOT of nice stuff in there. Thanks a bunch for the new features and functionality!!



As far as a sample...I will try. I experience the error only when a BBS is employed to fill a DevEx XtraGrid object. I do not get the error in any other way. I have not tried a standard grid. If I get the opportunity to produce a sample, I'll include both. I am just now setting up the Inventory Adjustments window to issue a breakpoint during the close event. Hopefully, I can see something going on there. Fortunately, I was able to get the designer working again on that window.



I'll keep working on it and updating you on the steps I am taking.



Thanks for checking in!

Bill
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Before you spend too much more time, just drag a DataGridView onto your dialog and see if you experience the same problems. Grids are always a pain and since they are so "fat" they can introduce tings at times do to forces outside of SF. As such, I always get back to basics when I see strangeness like this.



Let me know...and again, I really am sorry for the long delay...I just lost this thread to the abyss....but now it is found BigGrin
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search