By Edhy Rijo - 5/29/2009
Hi,
I am working with a DataGridView in a child form, if I cancel the childform with the follwing code:
DialogResult = Windows.Forms.DialogResult.Cancel
Then I get the following exception:
KeyNotFoundException
The given key was not present in the dictionary.
Source : mscorlib
Stack Trace:
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 CardTrackingSystem.frmActivateCardsItems.Dispose(Boolean disposing) in E:\Visual Studio 2008 Projects\StrataFrame\Card Tracking System Projects\CardTrackingSystem.NET\CTS Solution\Card Tracking System\Dialogs\Transaction Forms\Activate Cards\frmActivateCardsItems.Designer.vb:line 10
at System.Windows.Forms.Form.Close()
at MicroFour.StrataFrame.UI.Windows.Forms.ChildFormDialog.ShowDialog(Object[] Arguments)
at MicroFour.StrataFrame.UI.Windows.Forms.ChildFormDialog.ShowDialog()
at CardTrackingSystem.frmActivateCards.cmdAddCards_Click(Object sender, EventArgs e) in E:\Visual Studio 2008 Projects\StrataFrame\Card Tracking System Projects\CardTrackingSystem.NET\CTS Solution\Card Tracking System\Dialogs\Transaction Forms\Activate Cards\frmActivateCards.vb:line 800
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
at System.Windows.Forms.ToolStripButton.OnClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
at System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
at System.Windows.Forms.ToolStrip.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.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ToolStrip.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)
The DataGridView is being populated with a BBS and the error only happens if the grid has some data. I don't know what "Key" it may be looking for? Also I would like to note that the BO assigned to the BBS has come Custom Field Properties which are not used in the DataGridView.
|
By Trent L. Taylor - 6/1/2009
Before we get into samples, for grins, in the OnFormClosing of the form, remove the binding from the grid to see if the error goes away.
|
By Edhy Rijo - 6/1/2009
Hi Trent,
Thanks for the inside, I am really going nuts with this DataGridView control.
I tried this code and it is not working:
Protected Overrides Sub OnFormClosing(ByVal e As System.Windows.Forms.FormClosingEventArgs)
MyBase.OnFormClosing(e)
Me.DataGridView1.DataSource = Nothing
End Sub
I tried the code before and after MyBase call. It is this what you suggested?
|
By Trent L. Taylor - 6/1/2009
Well, to isolate the issue, just add a temp button to remove this and then close the dialog. FWIW, this is actually something that is done often, so I know it will work. But like anything else with grids, environment and code always plays a factor.
If you have any refresh code anywhere in your dialog, this could cause a potential issue as well if it is being called during the closing of the dialog.
|
By Edhy Rijo - 6/1/2009
Humm, I added the butting and called the same code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.DataGridView1.DataSource = Nothing
End Sub
Trent L. Taylor (06/01/2009) Before we get into samples, for grins, in the OnFormClosing of the form, remove the binding from the grid to see if the error goes away.
When you say "remove the binding from the grid" you meant Me.DataGridView1.DataSource = Nothing?
|
By Edhy Rijo - 6/1/2009
Trent,
Playing with this a bit, I came up with the following code which seams to work:
Protected Overrides Sub OnFormClosing(ByVal e As System.Windows.Forms.FormClosingEventArgs)
MyBase.OnFormClosing(e)
'-- Remove the DataSource from the grid to avoid the error while closing the form.
' Error:
' KeyNotFoundException
' The given key was not present in the dictionary.
Me.DataGridView1.DataSource = Nothing
Me.BusinessBindingSource1.Dispose()
End Sub
Do you see any technical problem with this code?
|
By Trent L. Taylor - 6/2/2009
That should work fine. Run with it and let's see if it resolves your issue.
|
By Larry Caylor - 6/4/2009
I just ran into the same issue after upgrading an existing application to v 1.6.7. I'm using the Infragistics grid. The workaround of unbinding the grid/s from the datasource works but something in the new version of SF introduced this since the app has worked perfectly for months on the previous version of SF.
|
By Edhy Rijo - 6/4/2009
Hi Larry,
My guess is that something changed in the BBS which may be causing this behavior.
|
By Trent L. Taylor - 6/4/2009
The BBS did change as there was a memory leak. The memory leak ensures that the internal objects are disposed of...so there was actually a leak. I will see if I can reproduce the exception.
|
By Bill Cunnien - 7/27/2009
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
|
By Bill Cunnien - 7/27/2009
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:
|
By Bill Cunnien - 7/27/2009
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.
|
By Bill Cunnien - 7/28/2009
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)
|
By Bill Cunnien - 7/28/2009
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?
|
By Bill Cunnien - 7/29/2009
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.
|
By Bill Cunnien - 7/29/2009
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.
|
By Trent L. Taylor - 7/29/2009
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!
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!
|
By Bill Cunnien - 7/29/2009
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
|
By Trent L. Taylor - 7/29/2009
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
|
By Bill Cunnien - 7/29/2009
I dropped a DataGridView onto the form and disconnected the DevEx grid from the main BBS (I left the two repository BBSs connected). I connected the main BBS to the DataGridView. When closing the form, I got the same error. So, I deleted all of the BBSs. Ran the form, closed it and received no error. Then, I added a new BBS to the form and wired it to the DataGridView. I ran the app, opened the form, saw the data in the grid, then closed the form. No error! I then wired only the main BBS to the DevEx Grid. When closing the window, it generated the same error. So, the combination of the DevEx grid (9.1.5) and the BBS (versions 1.6.6, 1.6.7 and 1.7.0) makes the window fail on closing. The dispose method...inserting my guesswork here...seems to be trying to get rid of objects that may have already been dumped via the DevEx grid disposal process.
Thoughts?
|
By Bill Cunnien - 7/29/2009
I attempted to recreate the error for you in a sample application. The app that I created was a VB app. I am not getting the same error (although, I forgot to fill the BO). Of course, we are not dealing with apples and apples, so I am going to create a C# app, instead. Stand by.
|
By Bill Cunnien - 7/29/2009
The C# app sample is complete. There are no errors in that sample app....so, I am totally vexed and befuddled. What do I do, now?
|
By Bill Cunnien - 7/29/2009
References...how do I cleanup the references? I attached a window shot of the Add References for a project. Two of the references I need in the project are version 1.7.0 but the other two are 1.6.0. Ugh! I assume that is not correct.
I have uninstalled and reinstalled so many times. What is my best path for fixing this issue?
|
By Bill Cunnien - 7/29/2009
Attached are two assemblies and their version tabs. Is the business.dll supposed to have an assembly version of 1.6?
|
By Trent L. Taylor - 7/29/2009
When you installed SF 1.7.0, it did not clear out all of the 1.6.0 assemblies (which can be caused by several things). Before you get much deeper, manually remove any 1.6.0 references then reload the 1.7.0 build. Make sure that all of your files get updated to the 1.7.0 version otherwise you will have other weirdness.
Second, download the SF source code, build it in debug mode, which should also update your GAC references. THEN, get out of VS. Open VS back up and you should have SF DLLs in debug mode which will allow you to debug and break on any exception allowing you to trace and see where the point of failure is, look at a stack trace, etc.
I really think that you are dealing with an issue within your code. For example, something is causing the grid to re-evaluate the bound data source which is causing the error.
First, before you go crazy, just override the OnFormClosing method of the form, and manually remove the data source form the grid:
MyGrid.DataSource = null;
If you are using VB.NET then replace the null with Nothing. That should prevent anything from trying to evaluate the BBS on the form close.
|
By Bill Cunnien - 7/29/2009
So I go to uninstall SF and start over (again) and I get this...see attachment.
|
By Trent L. Taylor - 7/29/2009
Where are you getting this? Most likely you are just not getting all of the assemblies updated into the GAC and within the ProgramFiles\Common Files\MicroFour\StrataFrame folders. Make sure you have permissions to update and that nothing is in use when you load the assemblies.
|
By Keith Chisarik - 7/29/2009
You incremented the assembly version this release, not just the file version?I hope not.
|
By Jeff Pagley - 7/29/2009
Hi SF Team,I am getting the same error when closing one of my forms in an application which has been working for months. I am not using a grid. I am using a form with combination of Strataframe DevEx controls bound to BO and the Strataframe Listview that I am filling using the PopulationDataSourceSettings properties. In fact, I had 2 BBS objects on the form I was not using. So I deleted one of them. After that the problem went away. Obviously, I am not sure why. I thought this feedback might help. Thanks, Jeff
|
By Bill Cunnien - 7/29/2009
Where are you getting this?
It popped up when I began the uninstall of StrataFrame. Naturally, the uninstaller closed. I have been able to get it going again.
Sorry. I may be a little jumpy at the moment.
I will be cleaning all assemblies referencing StrataFrame, then reinstalling. This will take a little while longer.
|
By Bill Cunnien - 7/29/2009
I am getting the same error when closing one of my forms in an application which has been working for months.
Ooooo...another victim! Thanks for chiming in. I do not feel so alone, now.
|
By Bill Cunnien - 7/29/2009
Just FYI, the uninstall left the following in the GAC: MicroFour StrataFrame UI Expanded, 1.7.0.0
|
By Trent L. Taylor - 7/29/2009
You incremented the assembly version this release, not just the file version?
It was time, my brother. It had to be done!
|
By Trent L. Taylor - 7/29/2009
Jeff, nothing has changed in this respect, so I am not sure if this is the same issue. If you are still having an issue, let me know. Thanks.
|
By Trent L. Taylor - 7/29/2009
Just FYI, the uninstall left the following in the GAC: MicroFour StrataFrame UI Expanded, 1.7.0.0
Thanks, I will make sure it gets cleaned up. This is a new assembly and will have absolutely no bearing on this issue, just FYI
|
By Bill Cunnien - 7/29/2009
Yup...I figured that. I am reinstalling the framework, now. All vestiges of the older assemblies have been vanquished. I hope to run smack dab into success here really soon!
|
By Bill Cunnien - 7/29/2009
Trent L. Taylor (07/29/2009)
When you installed SF 1.7.0, it did not clear out all of the 1.6.0 assemblies (which can be caused by several things). Before you get much deeper, manually remove any 1.6.0 references then reload the 1.7.0 build. Make sure that all of your files get updated to the 1.7.0 version otherwise you will have other weirdness. Second, download the SF source code, build it in debug mode, which should also update your GAC references. THEN, get out of VS. Open VS back up and you should have SF DLLs in debug mode which will allow you to debug and break on any exception allowing you to trace and see where the point of failure is, look at a stack trace, etc. I really think that you are dealing with an issue within your code. For example, something is causing the grid to re-evaluate the bound data source which is causing the error. First, before you go crazy, just override the OnFormClosing method of the form, and manually remove the data source form the grid: MyGrid.DataSource = null; If you are using VB.NET then replace the null with Nothing. That should prevent anything from trying to evaluate the BBS on the form close.
I reinstalled. I rebuilt the inherited UI project with the DevEx version I am using (9.1.5 . . . 9.2 is due out soon). I added the proper SF references to the project from which I removed them. I built and ran the app. When I closed the same window, I still get the error.
So, I tried the code you suggested on the OnFormClosing event. The error still occurs.
So, I setup the source code for debugging. When I run the app, the error still occurs. I have attached a screen shot of the debugging. The stack trace is the same as I have already posted.
Any more ideas?
|
By Bill Cunnien - 7/29/2009
Btw, if you are interested, the SharedTableKey being passed to Me._Tables is "c67e1094-d653-4038-a662-45fbf647b5ca".
Me._Tables count is 3; however, only two keys are present...one for the InventoryTransactions table and one for the ItemClasses table. The missing one, which is on the form represented by a BO/BBS combo, is the UnitMaster table. Neither of those existing keys match the one being passed. I assume it is for the missing UnitMaster table.
Interesting.
|
By Peter Jones - 7/29/2009
Hi,We have the same problem with the ThrowKeyNotFoundException occuring when we close a form. We upgraded to 1.7 yesterday, having been previously on 1.6.6. We're also DevExpress users, and have found that the problem seems to be limited to forms with Devexpress Grids or NavBarControls on them. We have discovered a couple of other interesting things: 1. We can open a form and close it if the grids on it have no data. By this I mean that the BOs on the form have been populated from their stored procedures using a date range that contains no data. 2. After the same form has been populated with data, and we attempt to close it, the exception occurs after about half the BOs have been disposed. There doesn't seem to be any significance about the one it stops on, and I haven't determined if it stops in the same spot each time. We're continuing with our investigation, but we have had some difficulty with the GAC and versions of the dlls after compiling Strataframe in debug mode. Building Strataframe puts a 1.6 reference in the GAC and seems to screw up our Project's references. Cheers, Peter
|
By Trent L. Taylor - 7/30/2009
Guys, I am going to need a sample. I have not been able to reproduce this. The version of DevExpress that we currently have is 8.2, so I am wondering if there is a later version that you are running on that is causing the issue.
|
By Bill Cunnien - 7/30/2009
I am using v9.1.5. 9.2 is due out soon. I will uninstall 9.1.5 and reinstall 8.2 and see what happens.
|
By Trent L. Taylor - 7/30/2009
Or...send me a sample and save the energy. I can change the references on this side, but I think that there is something going on with the grid and I would love to see if I am missing something at this point. Thanks.
|
By Bill Cunnien - 7/30/2009
I worked up a sample yesterday but it did not fail like my production application. That's why I started looking at assemblies. I'll post my findings here as soon as I get the DevEx 8.2.10 version installed.
Thanks!
Bill
|
By Trent L. Taylor - 7/30/2009
OK, thanks.
|
By Bill Cunnien - 7/30/2009
Nothing is easy. What a killer downgrading to v8.2.10. So many errors to deal with in my codebase. It will be a little while for me to get through these. Sorry for the delay. Hope to have some more answers by the end of the day.
|
By Bill Cunnien - 7/30/2009
This is not funny. I am getting the same error. The same spot--SharedDataTableCollection class on the get_Item property retrieval. It's 4pm. Not likely I will solve this today. Four days, now, with absolutely no progress.
Is there a place for me to download 1.6.6? I'd like to go back to that version. Thanks.
|
By Bill Cunnien - 7/30/2009
Is the following code necessary (red highlight)? If so, why?
' From the BusinessBindingSource.vb in the Business Namespace
#Region " Protected Methods "
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
[color=#FF0000]Me.RemoveBOHandlers()[/color]
Me._BusinessObject = Nothing
Me._BusinessObject_CurrentView = Nothing
End If
End If
'-- Base call
MyBase.Dispose(disposing)
End Sub
#End Region
Can I comment out the line and move on without big bad voodoo?
|
By Bill Cunnien - 7/30/2009
I commented out that code and everything works just fine. I am running SF 1.7.0 with DevEx 8.2.10. I am not going to take the next step and update DevEx. It appears that DevEx is not the issue (although, it could be somewhere in there...it is a complex issue, I suppose). Once I update DevEx to 9.1.5, I will report back here again. At least my app is running and I know that I can update the clients at this point.
Please let me know if I am doing serious damage by removing that code.
Thanks!
|
By Bill Cunnien - 7/30/2009
Bill Cunnien (07/30/2009) ...I am not going to take the next step and update DevEx.
Actually, I am updating the DevEx tools. Slight typo there. Sorry. I meant to say, "I am now going to take the next step..."
|
By Bill Cunnien - 7/30/2009
Ok...I got there. I am now running on SF 1.7.0 and DevEx 9.1.5. Of course, I do still have that RemoveBOHandlers method commented out in the BBS class. I am going to make a couple of quick changes to other areas in my application, run some tests, then post the update. Looks like I am back in business!
|
By Peter Jones - 7/31/2009
Hi Trent,
I just want to confirm that you guys are 'on the case'. We have also commented out that line of code that Bill highlighted and now our app works ok with SF 1.7 and DX 9.1.5. but what are the side effects (if any) of doing this?
Cheers, Peter
|
By Trent L. Taylor - 8/3/2009
It looks like this is ONLY happening on DevExpress grids version 9.x and greater. So something apparently changed. Instead of getting in contact with DevExpress, etc. we went ahead and made a code change in the event that another 3rd party control references an IBindingList implementation during disposal.
Ultimately this is a simple fix, but the reason for all of the confusion was due to different versions of a 3rd party control acting different ways. The next minor release posted will include this fix, but you can go ahead and change the source if you like temporarily. You WILL NOT have to maintain this source as it has already been changed. But the issue is that the _BusinessObject has already been disposed, thus when the grid implicitly attempts to dispose of the data source, an error occurs. Here is the code as it should be to resolve the error:
BusinessBindingSource, RemoveBOHandlers()
'''
''' Removes the necessary event handlers from the business object.
'''
'''
Private Sub RemoveBOHandlers()
'-- Make sure that the BO has a reference
If _BusinessObject Is Nothing Then Return
Try
'-- Remove the necessary handlers
RemoveHandler Me._BusinessObject.AfterAddNew, AddressOf BusinessObject_InternalAfterAddNew
RemoveHandler Me._BusinessObject.BeforeAddNew, AddressOf BusinessObject_InternalBeforeAddNew
RemoveHandler Me._BusinessObject.InternalAfterAddNew, AddressOf BusinessObject_InternalAfterAddNew
RemoveHandler Me._BusinessObject.CurrentDataTableRefilled, AddressOf BusinessObject_CurrentDataTableRefilled
RemoveHandler Me._BusinessObject.CurrentView.ListChanged, AddressOf BusinessObject_CurrentView_ListChanged
RemoveHandler Me._BusinessObject.Navigated, AddressOf BusinessObject_Navigated
RemoveHandler Me._BusinessObject.IsDirtyChanged, AddressOf BusinessObject_IsDirtyChanged
Catch ex As Exception
End Try
End Sub
|
By Edhy Rijo - 8/3/2009
Hi Trent,
I am happy to say that I made the changes posted before to the BusinessBindingSource, RemoveBOHandlers() and that fix the error or as you would say "Smoke it!!!!".
WARNING.... I just tested it once
|
By Jeff Pagley - 8/11/2009
Hi SF Team,I understand where to make the change but I am running VS 2005 and the Microfour Strataframe.sln is not loading. I have loaded the Microfour Strataframe Inherited IU project and updated the DevExpress references to v9.1.5 and created the new DLL successfully. I tried loading the Microfour Strataframe Business project, but I get over 100 errors. I am not sure what to do now. What are the steps I need to take to implement this fix or will you post a new dll with this fix? Thanks, Jeff
|
By Jeff Pagley - 8/12/2009
Hi SF,What is the status to my last post? Thanks, Jeff
|
By Trent L. Taylor - 8/13/2009
Sorry for the delayed responses. We have not been in the office the last several days for personal reasons.
At any rate, I am doing a new build - 1.7.0.1. This will include these changes for you. I will post it in the My Account area as soon as it is ready.
|
By Ross L. Rooker, Sr. - 8/16/2009
Trent, I am also getting this same error on a form that has worked until the upgrade to 1.7.0. There are no third party controls on this form. Just StrataFrame and Grids. One of them has a BBS. Is there a quick fix for this? or do I need to download 1.7.0.1?The error: Source : mscorlib Stack Trace: 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 TrustedVALET.forms.order.frmOrder.Dispose(Boolean disposing) in C:\TrustedVALET\TrustedVALET\forms\order\frmOrder.Designer.cs:line 12 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) The error is not very helpful as you can see the 2nd line in the stack trace is: at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
|
By Edhy Rijo - 8/17/2009
Ross L. Rooker, Sr. (08/16/2009) Is there a quick fix for this? or do I need to download 1.7.0.1?
Hi Ross,
I would try 1.7.0.1 first.
|
By Trent L. Taylor - 8/17/2009
Ross,
I am assuming that you are using DevExpress grids or something along those lines. Yes, please download the 1.7.0.1 build as we made a change to prevent any 3rd party control that references the IBindingList interface during or after disposal.
|
By ChanKK - 3/5/2010
Hi
I just tried to upgrade my SF 1.6.6.9 to 1.7.0.6. Very unfortunately, I hit the same error as this thread. I have downloaded latest SF source code and the changes is there. I recompile the code and use the compiled dll instead of the one from installer, but same result.
Anything to check?
Thank you
|
By ChanKK - 3/5/2010
Additionally, I am using DevExpress 9.1.4
|
By ChanKK - 3/5/2010
Attached sample project.
|
By Trent L. Taylor - 3/8/2010
Wow...this is an ironic twist of fate. A while back we made a number of changes to make sure that memory was cleaned up as DevExpress Winform grids would not dispose the enumerator, thus causing a major memory leak. So we added logic to force the grid to clean up after itself and dispose of the internal enumerator objects. This has been largely tested. However, DevExpress didn't follow the same logic on their web grid, thus causing the objects to dispose prematurely.
So we had to alter the way that the WBBS works versus the standard BBS. Ultimately it was a very small change and will not affect any users not using the DevExpress web grid. Just FYI, Infragistcs, Telerik, and the standard GridView all worked. DevExpress is the only one that failed.
So this issue has been resolved and I will put up a temporary build for you here in a bit so you can move forward.
|
By ChanKK - 3/8/2010
Hi,
Thank you. I am downloading, will inform you once testing done.
May be you should inform DevExpress about this as well.
Thank you
|
By Trent L. Taylor - 3/8/2010
Sounds good, Chan. Thanks.
|
By ChanKK - 3/8/2010
Hi,
I have tested and found new issues.
Testing project
Problems:
1. Takes long time to load when press refresh button or F5
2. The grid view keeps on loading with no end when u clicks any page number of the grid or enters any words in filter row
Beside, for any BO's that using GUID will hit the error as attached
Please advice ASAP.
Thank you
|
By Trent L. Taylor - 3/10/2010
This is on my radar and I am looking into this. Sorry for the delay.
|
By Hugo R. Figueroa - 3/10/2010
I have updated to 1706 (I didn't knew about this thread) and now I am having the same problem as Chan ( I use DevExpress grids and controls).
I am stuck now.
|
By Hugo R. Figueroa - 3/11/2010
This is in a Web Application (Devexpress web Grids and web controls)
|
By Trent L. Taylor - 3/12/2010
Hugo,
I have sent you a PM with a temporary download.
|
By Hugo R. Figueroa - 3/15/2010
Thank you.
|
By Hugo R. Figueroa - 3/16/2010
Thank you. It solved the problem.
|
By Trent L. Taylor - 3/17/2010
Glad to hear it!
|
By abenge - 4/14/2010
I'm seeing this same error running SF 1.7.0.6 and DevExpress 9.3.3. When I add a DevEx GridView to my web application and bind to SF WBBS on page load the key error is thrown..I replace my DevEx GridView with a standard gridview and no problems..Any thoughts?
|
By Dustin Taylor - 4/14/2010
This should be resolved in 1.7.0.7. It is available in your my account area under the Application Framework - Beta section.If you load that build and still experience the issue, then please let us know and we will work through it. Thanks!
|
By abenge - 4/15/2010
Ok great. I'll download and give that a try.Thanks!
|