HandyOrg / HandyOrg/HandyControl
'The type initializer for 'HandyControl.Controls.Window' threw an exception.'
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.2k
- Forks
- 1.2k
- PR merge metrics
- No merged PRs in 30d
Description
The exception occurs at Messagebox.Show/Ask/Error etc calls.
ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
To Reproduce
Steps to reproduce the behavior:
This happens randomly and I couldn't find the exact way to reproduce.
Environment (please complete the following information):
- .net: [.net core 3.1
- IDE [e.g. vs2019]
- Version [2.5.3.2]
Stack Trace-
at HandyControl.Controls.Window..ctor()
at HandyControl.Controls.MessageBox..ctor()
at HandyControl.Controls.MessageBox.CreateMessageBox(Window owner, String messageBoxText, String caption, MessageBoxButton button, MessageBoxImage icon, MessageBoxResult defaultResult, String cancelContent, String confirmContent, String yesContent, String noContent)
at HandyControl.Controls.MessageBox.<>c__DisplayClass44_0.<Ask>b__0()
at System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout)
at System.Windows.Threading.Dispatcher.Invoke(Action callback)
at HandyControl.Controls.MessageBox.Ask(String messageBoxText, String caption)
at demo.ViewModels.MainWindowViewModel.DeleteIconsMethod() in C:\Users\myusername\source\repos\demo\demo\ViewModels\MainWindowViewModel.cs:line 441
at Prism.Commands.DelegateCommand.Execute()
at Prism.Commands.DelegateCommand.Execute(Object parameter)
at Prism.Commands.DelegateCommandBase.System.Windows.Input.ICommand.Execute(Object parameter)
at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated)
at System.Windows.Controls.MenuItem.InvokeClickAfterRender(Object arg)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the HandyControl.Controls.Window constructor and follow the stack trace through MessageBox.CreateMessageBox and MessageBox.Ask, using the supplied ArgumentOutOfRangeException as the entry point. Investigate why the randomly triggered MessageBox calls access an invalid collection index; done means the reported calls no longer throw this initializer exception, with reproducible verification if a test path can be established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100