This is a migrated thread and some comments may be shown as answers.

RadOpenFolderDialog Spurious Exceptions

6 Answers 110 Views
FileDialogs
This is a migrated thread and some comments may be shown as answers.
gordon
Top achievements
Rank 1
gordon asked on 30 Oct 2018, 10:32 PM

I'm getting spurious exceptions when opening this dialog.

var dialog = new Telerik.Windows.Controls.RadOpenFolderDialog
                {
                    Header = "Import Fonts",
                    FileName = Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
                    RestoreDirectory = true,
                    InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop),
                    Multiselect = true
                };
                if (dialog.ShowDialog() ?? false)
                {
                    eventAggregator.GetEvent<ImportEvent>().Publish(dialog.FileNames);
                }

 

2018-10-30 16:26:23,708 [1] ERROR FontAgent.App System.IndexOutOfRangeException: Index was outside the bounds of the array.
   at System.Windows.Controls.ItemContainerGenerator.RealizedItemBlock.ContainerAt(Int32 index)
   at System.Windows.Controls.ItemContainerGenerator.ContainerFromIndex(Int32 index)
   at Telerik.Windows.Controls.FileDialogs.HistoryNavigationPaneControl.UpdateSelectedHistoryDirectory(Boolean navigateToCurrentDir)
   at Telerik.Windows.Controls.FileDialogs.HistoryNavigationPaneControl.FileSystemInfoWrapperFactory_ChildFileDeleted(Object sender, ChildFileDeletedEventArgs e)
   at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
   at Telerik.Windows.Controls.FileDialogs.FileSystemInfoWrapperFactoryBase.OnChildFileDeleted(String filePath, DirectoryInfoWrapper parentFolderPath, Boolean isRename)
   at Telerik.Windows.Controls.FileDialogs.FileSystemInfoWrapperFactory.CleanupPath(String filePath, DirectoryInfoWrapper parentWrapper, Boolean isRename)
   at Telerik.Windows.Controls.FileDialogs.DirectoryInfoWrapper.<>c__DisplayClass3.<OnFileChanged>b__2()
   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)

Any idea what's going on?  Thanks.

6 Answers, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 02 Nov 2018, 04:11 PM
Hello Gordon,

Thank you for the provided stack trace and example code. 

Looking over the provided stack trace, it seems that the ChildFileDeleted event is thrown. This happens when a file or folder, that the dialog has already made a wrapper for, is either deleted, or renamed. Since I noticed that the InitialDirectory is the Desktop, can you check whether you have some processes running that might delete or rename a file or folder?
Alternatively, if you think of another way that such modifications can occur during the opening of the dialog, please share them so that I can try and reproduce the same behavior on my end. You can also share if the application stops after the exception, or the exception is displayed only in the Visual Studio output.

I am looking forward to your reply.

Regards,
Vladimir Stoyanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
gordon
Top achievements
Rank 1
answered on 02 Nov 2018, 04:57 PM

Hello Vladimir,

I cannot think of any app or process that is currently running on my system that would delete or rename a file or folder.  I can, however, think of applications that would do this.  For example, I have an application (currently not running, and not running when I got the exception) that is similar to Dropbox, but moves files it has uploaded to the the Recycle Bin.  

My application crashes when I get the above exception.  I do get FileNotFoundExcpetions that seem to be handle internally by the RadOpenFolderDialog.  They appear to be due to permissions.  Here are a few examples.  

 

Exception thrown: 'System.IO.FileNotFoundException' in System.dll

Additional information: Error reading the C:\System Volume Information directory.

Additional information: Error reading the C:\Users\.NET v4.5 directory.
Additional information: Error reading the C:\Users\.NET v4.5 Classic directory.
Additional information: Error reading the C:\MSOCache directory
Additional information: Error reading the C:\Users\Default User directory.
Additional information: Error reading the C:\Users\DefaultAppPool directory.

I will continue to monitor the situation, and update you if I obtain any additional information.

Thanks.

0
Vladimir Stoyanov
Telerik team
answered on 06 Nov 2018, 04:10 PM
Hello Gordon,

Thank you for the additional information. 

Indeed the FileNotFoundExceptions are internally handled by the dialog and are most likely due to system permissions. 

As for the System.IndexOutOfRangeException, in order to provide you with more information, I need to be able to reproduce the exception on my end. I prepared a small sample project, based on the provided code, which is correctly displaying the RadOpenFolderDialog on my side and I am attaching it for your reference. May I ask you to check it out and see how it differs from the setup at your end?

In order to further assist you, may I kindly ask you to modify the sample project or prepare a sample project of your own and some steps which I can follow in order to reproduce the exception on my end? You can open a new support ticket with the sample project inside.

I am looking forward to your project.

Regards,
Vladimir Stoyanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
gordon
Top achievements
Rank 1
answered on 14 Nov 2018, 07:30 PM

Hi Vladimir,

I cannot build or run the project you attached.  I'm using VS2015.  I do not have time at the moment to figure out why.  Thanks.

0
gordon
Top achievements
Rank 1
answered on 14 Nov 2018, 07:35 PM
I was able to get the project to run and build.  I had extracted it to a different folder, which somehow caused a problem.  I haven't been able to reproduce the crash yet, but it's intermittent.  
0
Vladimir Stoyanov
Telerik team
answered on 19 Nov 2018, 04:26 PM
Hello Gordon,

Thank you for the update. 

If you manage to reproduce the crash or find the reason for it, please write back or open a new support ticket with the necessary steps to reproduce the exception inside and I will be happy to further investigate.  

Regards,
Vladimir Stoyanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
FileDialogs
Asked by
gordon
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
gordon
Top achievements
Rank 1
Share this question
or