Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
This repository was archived by the owner on May 1, 2024. It is now read-only.

Index out of bound exception #122

Open
@HarshitPradhan

Description

@HarshitPradhan

Bug description

While working on my application it's a once in a lifetime scenario that I've encountered this exception and I'm unable to figure it out why this error came and how to fix this error.

This is the message that I have received

RefreshCountingFromThread Thread Exception : Index was outside the bounds of the array.: at System.Collections.Generic.Dictionary2.TryInsert(TKey key, TValue value, InsertionBehavior behavior) at MvvmBlazor.Internal.WeakEventListener.WeakEventManager.AddWeakEventListener[T](T source, Action2 handler)
at MvvmBlazor.Internal.Bindings.Binding.AddCollectionBindings()
at MvvmBlazor.Internal.Bindings.Binding.SourceOnPropertyChanged(Object sender, PropertyChangedEventArgs e)
at MvvmBlazor.Internal.WeakEventListener.WeakEventListenerBase`2.HandleEvent(Object sender, TArgs e)
at MvvmBlazor.ViewModel.ViewModelBase.OnPropertyChanged(String propertyName)
at MvvmBlazor.ViewModel.ViewModelBase.Set[T](T& field, T value, String propertyName)
at <ViewModel_Full_Path>.UpdateDetailView()

Expectation

How to not get this exception again as the application is used by many clients and the application is deployed in the field already.

Code sample

public ObservableCollection<DetailDataDTO> DetailsData
{
    get { return detailsData; }
    set { Set(ref detailsData, value); }
}

private ObservableCollection<DetailDataDTO> detailsData;

private void UpdateDetailView()
{
	...
	...
	...
	this.DetailsData = this.DataInventory.GetDetailsData();
	...
	...
	...
}

Version

2.0.0

Are you using Blazor WASM or Blazor Server?

Blazor Server

What operation system are you working with?

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions