Using Revit Viewer 2018 to Debug in Visual Studio

Using Revit Viewer 2018 to Debug in Visual Studio

Anonymous
Not applicable
933 Views
2 Replies
Message 1 of 3

Using Revit Viewer 2018 to Debug in Visual Studio

Anonymous
Not applicable

Hello, forum!

 

I’ve recently started using Visual Studio to code add ins for Revit and would like to be able to debug right from the VS console. Unfortunately, I only have access to Revit Viewer. I’ve tried putting the file path to the Revit.exe file under Project > Properties > Debug > Start External Program and adding “/viewer” to the command line arguments, but it always causes Revit to crash with error x0. Using the Revit Viewer shortcut file path also results in an error as VS expects a .exe file. The only work around I’ve found so far is to run the add in directly from an open Revit Viewer window, but then I lose access to the debugging tools in VS. 

 

On Jeremy Tammik's suggestion, I opened Revit Viewer and used "Attach to Process" to run my add in and debug it. So far, that's been working well (Thanks, Jeremy!), but I'm still curious to know if anyone has come up with a way to make Revit Viewer open when the addin is run. 

 

Thanks!

0 Likes
934 Views
2 Replies
Replies (2)
Message 2 of 3

giobro
Contributor
Contributor

Hi Lia,

 

Sorry for the late reply. Adding /viewer /language ENU to the Command line arguments works for me (tested both in 2018 and 2019).

 

revitViewer.PNG

0 Likes
Message 3 of 3

Anonymous
Not applicable

Hello again, 

I've found that "Use managed compatibility mode" under Debug > Options > Debugging > General must be checked. 

Thanks for your help!

0 Likes