Crash with Desktop Connector
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have an application that allows the user to browse and open files. The open command starts by simply showing a standard file dialog and letting them browse to the file to open. After some user reports and some investigation, it appears that something is creating an issue with drives from Autodesk Desktop Connector.
Here is the relevant part of my (very simple) method:
var openDialog = new OpenFileDialog
{
Title = "Keynote File Location",
Filter = "Text Files (*.txt)|*.txt",
FilterIndex = 1,
CheckFileExists = true,
CheckPathExists = true
};
if (Directory.Exists(KMApplication.Settings.DefaultDirectory))
{
openDialog.InitialDirectory = KMApplication.Settings.DefaultDirectory;
}
//Show open dialog & get path
if (openDialog.ShowDialog() == true)
{
... do stuff with the file
}
In my experiments this worked as expected in Revit 2016 and 2019, but in 2017.2 and 2018.3 if I browse to any drive that is in Desktop Connector it freezes for a while, sometimes gives a blank error message with a guid in the title (though not always) and crashes Revit... One user did get an error dialog (though I did not); the relevant portion of that error stack is as follows:
Error Stack:
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at MS.Internal.AppModel.IFileDialog.Show(IntPtr parent)
at Microsoft.Win32.FileDialog.RunVistaDialog(IntPtr hwndOwner)
at Microsoft.Win32.CommonDialog.ShowDialog()
at RDES.KeynoteManager.KMCore.AppCommands.Exec_Open(Object sender, ExecutedRoutedEventArgs e)
This is just a standard Microsoft.Win32.OpenFileDialog... And other strange part is that I have a version of my software that runs outside of Revit and it works fine there and opens the file from the connector.
Anyone run into this before or know what to try?