Method 2: Use COM+
On a Sage CRM server, 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 | Application and follow the steps in the wizard:
a. On the Install or Create a New Application step, select Create an empty application.
b. Enter a name for the new application. Make sure you select Server application. Select Next.
c. On the Set Application Identity step, select 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.
d. Complete the wizard. Your new application appears under the COM+ Applications node.
In the left pane, select 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:
a. On the Import or install a component step, select Import component(s) that are already registered.
b. On the Choose Components to Import step, select Sage.CRM.Wrapper.SageCRMBase in the list.
c. 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:
a. In Visual Studio, add a breakpoint to your code as necessary.
b. From the main menu, select Debug | Attach to Process.
c. Select the process that has the ID you viewed in step 7 of this procedure.
d. Select Attach.
When you run your code, it stops at the breakpoint.