Pigeon Agents Development Debugging Agents - DatasmithSA/Pigeon-Voice-Training GitHub Wiki
In order to debug your custom Pigeon agents from Visual Studio follow these steps:
- Configure Pigeon Voice Server: in order for you agents to run they need to be loaded by the Pigeon Voice Server on startup. We will use the Pigeon Voice Manager to point the server to our custom agents library.
- Open the Pigeon Voice Manager from the Desktop or the Windows Start menu.
- Select the Agents component in the components list.
- Assembly and Namespaces: In order for the Pigeon Voice Server to load the Agents library we will need to provide the name of the assembly as well as the namespace in which our our agents are located within the library. In this example we have both our TCP/IP (LUT & ODR) and HTTP (Web) agents in the same assembly, but they could also be separated into two separate assemblies. Therefore there are separate settings for TCP/IP (LUT & ODR) agents and HTTP (Web) Agents.
- Enabled/Disabling TCP/IP and HTTP Agents: the two types of agents can each be disabled or enabled e.g. if web agents are not being used in the solution they could be disabled, which will instruct the Pigeon Voice Server to not load the HTTP agent assembly at startup.
- Editing Settings: in order to updated (edit) these setting, select the setting in the grid and click the pencil icon to update the setting. Change the setting value and click the OK button.
- Saving Settings: once all the settings have been updated, click the save icon to apply the changes. N.B. changes will only be read and applied by the Pigeon Voice Server after it has been restarted. /images/manager/Pigeon-Voice-Manager-Agent-Settings.png
- Deploy Agents Library: change the output directory of your project to the Pigeon Voice Server's execution directory.
- Build Output Settings: you can modify the Class Library project's Build Output settings to automatically build the DLL to the Pigeon Voice Server's execution directory:
- Right click the project in Visual Studio and click Properties.
- On the Build tab, change the output path to the above mentioned Pigeon Voice Server's execution directory. /images/agent-development/Pigeon-Agent-VS-Build-Settings.png
- Build Output Settings: you can modify the Class Library project's Build Output settings to automatically build the DLL to the Pigeon Voice Server's execution directory:
- Launch Pigeon Voice Server Attached Debugger: by default the Class Library project cannot be executed or debugged. Hence we will need to configure the project to launch the Pigeon Voice Server when choosing to debug the project resulting the debugger automatically attaching to the Pigeon Voice Server's process. This then allows us to set breakpoints in the custom agents' code which the debugger will break on when a voice device makes a request to a specific agent:
- Debug Settings: you can launch an external application when debugging a project in Visual Studio.
- Rick click the project in Visual Studio and click Properties.
- On the Debug: change the Start Action option to Start external program.
- Browse to the Pigeon Voice Server's executable, which will be located in the Pigeon Voice Server's executing/installation directory: C:\Program Files (x86)\Datasmith\Pigeon Voice Server\Pigeon.Voice.Service.exe /images/agent-development/Pigeon-Agent-VS-Debug-Settings.png
- Stop Pigeon Voice Server: ensure that you stop the Pigeon Voice Server if it is already running i.e. you cannot have more than one instance of the server running concurrently.
- Debug: debugging the project will startup the Pigeon Voice Server which will load the agents library and the Visual Studio debugger will be attached to the server's process.
- Right click the project and click Debug then Start new instance.
- The Pigeon Voice Server will startup and the Visual Studio debugger will be attached to the process allowing you to set breakpoints which will be hit when a voice device makes a request to a specific agent. /images/Pigeon-Voice-Server-Console.png
- Debug Settings: you can launch an external application when debugging a project in Visual Studio.