# How to debug modified OpenTAP code with custom plugins

**URL:** <https://forum.opentap.io/t/how-to-debug-modified-opentap-code-with-custom-plugins/71>\
**Category:** Ecosystem\
**Tags:** ks8400-editor\
**Created:** [October 22, 2020, 4:25pm UTC](https://forum.opentap.io/t/how-to-debug-modified-opentap-code-with-custom-plugins/71 "2020-10-22T16:25:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![david-wsd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opentap.io/david-wsd/32/204_2.png) [@david-wsd](https://forum.opentap.io/u/david-wsd)\
**Post date:** [October 22, 2020, 4:25pm UTC](https://forum.opentap.io/t/how-to-debug-modified-opentap-code-with-custom-plugins/71/1 "2020-10-22T16:25:02Z")

</div>

I’d like to understand the recommended process for modifying OpenTAP source code, and debugging (stepping through) the modified code, while also using my custom plugins.

I have a KS8400A license for the TAP Editor. I’ve cloned the OpenTAP repository, made a modification, and ran a successful build.

Upon building the OpenTAP solution, I see the binaries do not go to the %TAP\_PATH& directory. And running the solution brings up the Community Edition Editor. So the freshly built OpenTAP binaries are not living with my plugin binaries. Manually copying the binaries works, but is cumbersome.

What is the recommended method for debugging OpenTAP modifications with my own plugins?

---

<div class="post-metadata">

**Author:** ![brennen\_direnzo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opentap.io/brennen_direnzo/32/6_2.png) [@brennen\_direnzo](https://forum.opentap.io/u/brennen_direnzo)\
**Post date:** [October 22, 2020, 5:11pm UTC](https://forum.opentap.io/t/how-to-debug-modified-opentap-code-with-custom-plugins/71/2 "2020-10-22T17:11:05Z")

</div>

For the OpenTAP project, it builds into bin\Debug of the directory you have the repo mapped to. So, probably the easiest way would be to add a Post Build Event to the Tap.Engine project to copy the OpenTAP.dll:

```auto
copy /Y "$(OutputDir)Opentap.dll" "$(TAP_PATH)Opentap.dll"

```

Alternatively, you could create a test project that installed your plugins into the bin\Debug directory.

---

<div class="post-metadata">

**Author:** ![david-wsd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opentap.io/david-wsd/32/204_2.png) [@david-wsd](https://forum.opentap.io/u/david-wsd)\
**Post date:** [October 22, 2020, 5:37pm UTC](https://forum.opentap.io/t/how-to-debug-modified-opentap-code-with-custom-plugins/71/3 "2020-10-22T17:37:49Z")

</div>

In the scenario where I’m modifying OpenTAP code, I most likely want to step through the OpenTAP code. So it sounds like I need all my plugin binaries copied to OpenTAP’s bin\Debug directory. There are many of them, sometimes across multiple solutions. Can you expand on what you mean by a test project?

Maybe another alternative is to change the output folder in the OpenTAP solution to %TAP\_PATH%.

---

<div class="post-metadata">

**Author:** ![brennen\_direnzo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opentap.io/brennen_direnzo/32/6_2.png) [@brennen\_direnzo](https://forum.opentap.io/u/brennen_direnzo)\
**Post date:** [October 22, 2020, 6:09pm UTC](https://forum.opentap.io/t/how-to-debug-modified-opentap-code-with-custom-plugins/71/4 "2020-10-22T18:09:06Z")

</div>

You could use the same xcooy process to also copy the pdb file generated. That should be all you need.

I didn’t want to recommend making %TAP\_PATH% your default output directory as that will become difficult to clean up when you no longer want the debug build.

To avoid that you could either output to a specific directory rather than the root directory (just be careful as you may end up with duplicate DLLs) or you can clone your entire %TAP\_PATH% directory and create a “Test Automation Debug” directory and update the Tap.Engine project to output there.  
That would

1. Clone all your plugins in an easy way
2. Keep the debug files separate from your install.

---

<div class="post-metadata">

**Author:** ![david-wsd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opentap.io/david-wsd/32/204_2.png) [@david-wsd](https://forum.opentap.io/u/david-wsd)\
**Post date:** [October 22, 2020, 6:32pm UTC](https://forum.opentap.io/t/how-to-debug-modified-opentap-code-with-custom-plugins/71/5 "2020-10-22T18:32:38Z")

</div>

This is a noob .NET question, but how does the pdb file help me in this scenario?

---

<div class="post-metadata">

**Author:** ![brennen\_direnzo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opentap.io/brennen_direnzo/32/6_2.png) [@brennen\_direnzo](https://forum.opentap.io/u/brennen_direnzo)\
**Post date:** [October 22, 2020, 6:36pm UTC](https://forum.opentap.io/t/how-to-debug-modified-opentap-code-with-custom-plugins/71/6 "2020-10-22T18:36:55Z")

</div>

Basically, it is what allows to link to a debugger, but here is a more detailed description:

> **[Set symbol (.pdb) and source files in the debugger - Visual Studio](https://docs.microsoft.com/en-us/visualstudio/debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger?view=vs-2019)**
>
> Learn how to configure and manage symbol and source files in Visual Studio

---

<div class="post-metadata">

**Author:** ![david-wsd](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opentap.io/david-wsd/32/204_2.png) [@david-wsd](https://forum.opentap.io/u/david-wsd)\
**Post date:** [November 3, 2020, 5:50pm UTC](https://forum.opentap.io/t/how-to-debug-modified-opentap-code-with-custom-plugins/71/7 "2020-11-03T17:50:46Z")

</div>

Very cool, I’ve confirmed I can break on exceptions in opentap source code by including the pdb file along with the binaries.

---

<div class="post-metadata">

**Author:** ![brennen\_direnzo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opentap.io/brennen_direnzo/32/6_2.png) [@brennen\_direnzo](https://forum.opentap.io/u/brennen_direnzo)\
**Post date:** [November 3, 2020, 5:54pm UTC](https://forum.opentap.io/t/how-to-debug-modified-opentap-code-with-custom-plugins/71/8 "2020-11-03T17:54:09Z")

</div>

Great! Given you had some issues with this, it may be worth submitting an issue in Gitlab to improve the documentation around this.
