Debugging method 2: Use COM+
- On a computer where Sage CRM is installed, open Component Services (dcomcnfg.exe).
- In the left pane, expand Component Services | Computers | My Computer | COM+ Applications.
- Right-click the COM+ Applications node, select New | Applicationand follow the steps in the wizard:
- On the Install or Create a New Application step, click Create an empty application.
- Enter a name for the new application. Make sure you select Server application. Click Next.
- On the Set Application Identitystep, click This user, and then enter the user name and password of an administrator account.
The administrative permissions are required to attach the Visual Studio debugger. - Complete the wizard.
Your new application appears under the COM+ Applications node.
- In the left pane, click the plus sign (+) next to your application to expand it.
- Right-click the Components node, select New | Component and follow the steps in the wizard:
- On the Import or install a component step, click Import component(s) that are already registered.
- On the Choose Components to Import step, click to select Sage.CRM.Wrapper.SageCRMBase in the list.
- Complete the wizard.
- In the console tree of the Component Services window, expand the Running Processes node.
- In Sage CRM, run your .NET application.
Now your application is listed under the Running Processes node in the Component Services window. The process ID assigned to the application (shown in brackets next to the application name) is the process that you use in Visual Studio. - Enable the use of breakpoints for your .NET application in Sage CRM:
- In Visual Studio, add a breakpoint to your code as necessary.
- From the main menu, select Debug | Attach to Process.
- Select the process that has the ID you viewed in step 7 of this procedure.
- Click Attach.
When you run your code it stops at the breakpoint.