Crash with Desktop Connector

Crash with Desktop Connector

swfaust
Advocate Advocate
1,104 Views
8 Replies
Message 1 of 9

Crash with Desktop Connector

swfaust
Advocate
Advocate

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?

0 Likes
1,105 Views
8 Replies
Replies (8)
Message 2 of 9

Anonymous
Not applicable

I am having a similar problem when I try to launch from the Desktop Connector.  Revit starts to load and then crashes.

0 Likes
Message 3 of 9

swfaust
Advocate
Advocate

Would be happy to send journal files or whatever would be helpful here...  How else do I go about debugging this?

0 Likes
Message 4 of 9

Anonymous
Not applicable
I have no idea. I am in the same boat as you. Can't get Revit to launch
using the Desktop Connector.
0 Likes
Message 5 of 9

swfaust
Advocate
Advocate

Sorry, it was more a question for the Autodesk folks that watch these pages 🙂

0 Likes
Message 6 of 9

swfaust
Advocate
Advocate

Autodesk?

0 Likes
Message 7 of 9

swfaust
Advocate
Advocate

Managed to get this Exception stack trace today after trying to browse to a desktop connector file:

$exception{Autodesk.Revit.Exceptions.InternalException: A managed exception was thrown by Revit or by one of its external applications. at Autodesk.Revit.UI.UIApplication.get_ActiveUIDocument() at Autodesk.Revit.SmartMonkeyPlugin.SmartMonkeyAddon.OnTimeElapsed(Object sender, EventArgs e) at System.Windows.Threading.DispatcherTimer.FireTick(Object unused) 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 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) 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.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)}System.Exception {Autodesk.Revit.Exceptions.InternalException}

It opened the hubs and folders fine, but nothing displayed in the main UI section of the open dialog.  I cancelled out and then Revit acted strange for a few seconds, not letting me cancel a command, then crashed with this stack trace (I was running under debugger at the time).  

 

Looks like the ActiveUIDocument getter is throwing an exception somehow?  Not sure why it's related either, and there's some possibility that it's not but it seemed to be right after the dialog issue so seems highly likely that it's related.

 

This was in 2018.3.

Message 8 of 9

jeremytammik
Autodesk
Autodesk

Dear Stephen,

 

Thank you for your report and sorry for the delay in replying.

 

Sorrier still to hear about the issues you and Elise are encountering.

 

I took a look at the blog post explaining the desktop connector:

 

https://projectdelivery.autodesk.com/blog/desktop-connector

 

It describes it as 'Desktop Connector for BIM 360 Team'.

 

Quite a number of changes have been made lately to the way Revit and C4R interact with BIM 360 Team.

 

To the extent that, with Revit 2019, the whole system has been switched away from C4R and BIM 360 Team to BIM 360 Design and Forge.

 

Here is a pointer to the detailed report on the current status by Sasha Crotty:

 

http://thebuildingcoder.typepad.com/blog/2018/04/new-opportunities-in-the-forge-evangelist-team.html...

 

To analyse your specific problem, it would be very helpful to be able to take a look at a minimal reproducible case:

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#1b

 

Would it be possible for you to create one that I can share with the development team?

 

Thank you!

 

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 9 of 9

swfaust
Advocate
Advocate

I will try to create a reproducible case when I can...

0 Likes