-
Notifications
You must be signed in to change notification settings - Fork 51
Tips for debugging extensions
This page contains tips for better debugging of Concord extensions in particular, and, to some degree at least, Visual Studio all up.
Extensions which are either loaded into a worker process or are monitor components (components with a comment level less than 100,000) -and- a 64-bit process is being debugged will be loaded into a msvsmon.exe process.
The best way to debug these:
- Install the Microsoft Child Process Debugging Power Tool into Visual Studio.
- Configure your startup project (example: vsix.csproj) to use either native or interop debugging. If your startup project is already a VC project (.vcxproj), this is the default. If your startup project is a C# project, see below.
- Open 'Debug->Other Debug Targets->Child Process Debugging Settings' to configure the child process debugger.
- Check the checkbox to 'Enable Child Process Debugging'
- Set the '' action to 'Do not debug'
- Click the blank row in the process list, and add an entry for msvsmon.exe
- Set the 'Debugger Type' value to what is appropriate for your extension (ex: 'Managed (v4.6, v4.5, v4.0)' if your extension is implemented in managed code).
- Hit F5 to start debugging
If you have a .csproj as your startup project it is still sometimes useful to launch Visual Studio with native debugging enabled. There are three ways to do this:
1: Enable both managed and native debugging at the same time -- right click on your startup project and bring up project properties. Then switch to the 'Debug' tab and check the 'Enable native code debugging' checkbox. This setting is probably the best option as long as the performance of Visual Studio is acceptable in this mode.
2: Hand edit your .csproj to enable native-only debugging --
- Right click on the startup project and unload it
- Right click again and edit it
- Inside a
<PropertyGroup>add:
<!-- Enable native-only debugging -->
<DebugEngines>{3B476D35-A401-11D2-AAD4-00C04F990171}</DebugEngines>- Right click on your project and reload it + set it as the startup project
This approach is best as long as you don't need to debug any native code in Visual Studio, and you aren't frequently wanting to switch back and forth between managed-only and native-only debugging.
3: Add a dummy .vcxproj to your solution just for debugging
- Add a new C++ console app to your solution. Make call it something like 'NativeDebugDevenv'.
- Right click on your new project, and go to Build Dependencies->Project Dependencies, and make your new project dependent on the real startup project
- Right click on the project again and open project properties. Go to the 'Debug' tab, and make these changes:
- Change 'Launch' to 'Executable'
- Change 'Executable' to the path to devenv.exe (example: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.exe)
- Change 'Application arguments' to '/rootsuffix Exp'
- Change 'Working directory' to the directory of devenv.exe
- Make this new project your starting project
Concord Documentation:
- Overview
- Visual Studio 2022 support
- Concord Architecture
- Getting troubleshooting logs
- Tips for debugging extensions
- Component Discovery and Configuration
- Component Levels
- Navigating the Concord API
- Obtaining the Concord API headers, libraries, etc
- Concord Threading Model
- Data Container API
- Creating and Closing Objects
- Expression Evaluators (EEs)
- .NET language EEs
- Native language EEs
- Installing Extensions
- Cross Platform and VS Code scenarios:
- Implementing components in native code:
- Worker Process Remoting
Samples: