How to Debug a .NET Extension Application |
To complete the steps below you will need
An installed and working extension Application (see How To Install a .NET Extension Application)
Visual Studio installed on same system as the POS Client software
The POS client application is NOT running
Enable debugging of extension application in web.config.txt
Open the web.config.txt file for your POS Client and add the following line
<add key="Debug.[my-app-name].LoadDLLFromFileNameOrigin" value="1" />
where [my-app-name] is replaced with the name of your extension application in EMC (e.g., MyExtAppTest)
Setup Extension Application Project to run ServiceHost.exe
Open the Debug tab of the project properties
Set Start Action to "Start External Program" and select ServiceHost.exe
Set Start Options Working Folder to the folder containing ServiceHost.exe
Set breakpoint and start debugging
Set a breakpoint in the MyExtensionMethod function
Start debugging the project using the Debug | Start Debugging menu option
Presss the button that calls the extension method, execution should stop at the breakpoint you set in Visual Studio