The following procedure describes one way you can debug your .NET scripts using Microsoft Visual Studio .NET.
Compile your code with debugging information turned on:
On the csc command line, set the /debug+ option.
or
Use Microsoft Visual Studio .NET settings to set debug output.
From the File menu choose Build > Configuration Manager. From the Active Solution Configuration dropdown list, select Debug.
Build your assembly.
Close running instances of Visual Studio .NET that contain your source files.
In the next step, you start a new Visual Studio .NET instance to debug the MobiLink server and your .NET synchronization scripts.
Start Visual Studio .NET using a command line option to debug the MobiLink server.
At a command prompt, navigate to the Common7\IDE subdirectory of your Visual Studio .NET installation.
Start devenv (the Visual Studio .NET IDE) using the /debugexe option.
For example, type the following command line to debug the MobiLink server. Remember to specify mlsrv10 options, including the connection string and the option to load .NET assemblies.
devenv /debugexe %sqlany10%\win32\mlsrv10.exe -c ...
This causes Visual Studio .NET to start and mlsrv10.exe to appear in the Solution Explorer window.
Set up Microsoft Visual Studio for debugging .NET code:
In the Visual Studio Solution Explorer window, right-click mlsrv10.exe and choose Properties.
Change Debugger Type from Auto to Mixed or Managed Only.
This ensures Visual Studio .NET will only debug your .NET synchronization scripts.
Open the associated .NET source files and set break points.
Note: Open the source files individually in the mlsrv10 solution. Do not open the original solution or project file.
Start MobiLink from the Debug menu or using F5.
If prompted, save mlsrv10.sln in an appropriate location.
If the dialog No Symbolic Information appears, click OK to debug anyway. You are debugging the managed .NET synchronization scripts that MobiLink calls, not the MobiLink server itself.
Perform a synchronization that causes the code with a breakpoint to be executed by MobiLink.