NullReferenceException in Wisej.Web.DataGridView.OnBindingContextChanged

0
0

Dear Team,

 

occasionally, once a month, I am getting this exception in production.

Because infrequent, it is not possible to reproduce.

 

=== [System.NullReferenceException] = [0x80004003 (-2147467261)] ============= [an001] = [2024-01-31 10:51 JST (Wed)] ===

Object reference not set to an instance of an object.
—————————-
Source: Wisej.Framework
—————————-
at Wisej.Web.DataGridView.OnBindingContextChanged(EventArgs e)
at Wisej.Web.Control.OnParentBindingContextChanged(EventArgs e)
at System.Windows.Forms.Control.OnBindingContextChanged(EventArgs e)
at Wisej.Web.Control.OnBindingContextChanged(EventArgs e)
at Wisej.Web.Control.OnParentBindingContextChanged(EventArgs e)
at System.Windows.Forms.Control.OnBindingContextChanged(EventArgs e)
at Wisej.Web.Control.OnBindingContextChanged(EventArgs e)
at Wisej.Web.Control.AssignParent(Control parent)
at Wisej.Web.Control.ControlCollection.Remove(Control child)
at Wisej.Web.TabControl.ControlCollection.Remove(Control control)
at Wisej.Web.TabControl.ProcessCloseWebEvent(WisejEventArgs e)
at Wisej.Web.Control.Wisej.Core.IWisejComponent.Event(WisejEventArgs e)
at Wisej.Web.Application.ProcessWebEvent(WisejEventArgs e)
at Wisej.Web.Application.OnWebEvent(WisejEventArgs e)
at Wisej.Web.Application.Wisej.Core.IWisejComponent.Event(WisejEventArgs e)
at Wisej.Core.ComponentManager.DispatchEvents(Session session, ICollection events)
at Wisej.Core.ResponseManager.<>c__DisplayClass25_0.<OnEvent>b__0()
at Wisej.Core.IWisejSynchronizedImplementation.Lock(IWisejSynchronized target, Action action)
at Wisej.Core.ResponseManager.ProcessRequest(ServiceType service, Object message)

 

This could relate to changing of dgv.DataSource in Application.StartTask.

Sometimes dgv.DataSource in set to null.

  • You must to post comments
0
0

Hi Alaa, sorry for late reply.

 

I could not reproduce the NullReferenceException in a sample project, but a similar, maybe related error.

 

Attached is the sample project. (Using most recent Wisej 3.5.5 RC7 version)

 

Please take a look at the file \Views\DataGridBinding.cs

 

Please run and wait for some time, perhaps for 1-2 minutes.

After running correctly for some time, several types of exceptions will be thrown:

 

1) Index out of range (DataError event) .

2) System.InvalidOperationException: ‘BindingSource cannot be its own data source. Do not set the DataSource and DataMember properties to values that refer back to BindingSource.’

These exceptions can be caught and ignored.

As for the other NullReferenceException, I will need to do more testing (setting more properties). Maybe I can reproduce.

  • You must to post comments
0
0

Hi Kizaemon,

Can you share the Application.StartTask code snippet here or wrap up a small test case?

Best,
Alaa

//

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.