In this recipe we will demonstrate how to debug your server-side extensions with an on-premises Dynamics 365 instance. For simplicity, this recipe assumes that you have Visual Studio and your Dynamics 365 instance is running on the same server. It is also assumed that the plugin is running synchronously and not in sandbox mode. For other scenarios, read the There's more... section of this recipe.
In order to debug your server-side extension, you will need an instance of Visual Studio 2015 or 2017 (express edition is not recommended), your code, and the compiled Dynamic-link library (DLLs) and program database (PDBs) of your code deployed on the server.
Your plugin must be registered either on disk or the database. Either way, the corresponding PDB
files must go under <Dynamics 365 Server Folder>\bin\assembly
.