Debugging Your Application in Microsoft Visual Studio 2012

There are a few differences between debugging a standalone application (EXE) and an external application (DLL) that needs another program to launch it. To debug an application that is using the Autodesk Revit API it needs to be activated by Autodesk Revit. To do this in the developer environment for debugging you will need to:

  1. Open up the Visual Studio project for the API application. (For example AnalyticalSupportData_Info.csproj from the Samples folder)
  2. From the Project menu select AnalyticalSupportData_Info Properties
  3. Select the Debug tab on the left
  4. Select the "Start external program:" radio button
  5. Press the browse button and find the Revit.exe file and press Open
  6. Set some break points in your source code.
  7. From Visual Studio, select "Start Debugging". Autodesk Revit will launch.
  8. To hit a break point select the option for your program from the External Tools menu. Once the compiler reaches one of your break points it will stop to let you debug your program.