PropertyDescriptorCollection.find causing fatal crash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
We have a long-running process in 2019 that we need AutoCAD to report messages to the console window. We are doing this by executing a Windows Forms DoEvents() to get AutoCAD to refresh the message in the console. However, this will occasionally cause a fatal crash with an exception "object reference not set to the instance of an object" with this stack trace:
System.NullReferenceException: Object reference not set to an instance of an object.
at Autodesk.AutoCAD.Windows.Data.DynamicObjectBase.PropertyDescriptorCollection.Find(String name, Boolean ignoreCase)
at Autodesk.AutoCAD.Ribbon.LayerComboText.LayerComboText_Loaded(Object sender, RoutedEventArgs e)
Windows .NET messages ...
Is there a better way to get output messages while a process is running? Any ideas why this wouldn't work?