You can create a C# file, compile it into an executable file, and then use this file to run a management agent run profile. Although this is more complicated than creating a Visual Basic script to run a management agent run profile, the advantage is that the compiled file can run as a stand-alone file that does not require a script engine.

You can create a C# file using Synchronization Service Manager. You can then compile the file into an executable file by using the command-line compiler that is supplied with the Microsoft .NET Framework. To use the compiler, you must add the compiler location to the path variable of your computer.

To add the compiler path to your system

  1. Find the location of the .NET Framework compiler, csc.exe. Note the location of this file.

  2. Click Start, right-click My Computer, and then click Properties.

  3. On the Advanced tab of System Properties, click Environment Variables.

  4. In the System Properties list box of the Environment Variables dialog box, click Path, and then click Edit.

  5. In the Edit System Variable dialog box, go to the end of the text in the Variable value text box, and type a semi-colon (;) followed by the location of the .NET Framework compiler. Click OK to close the dialog boxes.

After you add the compiler path to your computer, you can use Synchronization Service Manager to create a source file for a run profile.

To create the source file for a run profile

  1. In Synchronization Service Manager, on the Tools menu, click Management Agents.

  2. In Management Agents, click a management agent.

  3. On the Actions menu, click Configure Run Profiles.

  4. In the Configure Run Profiles for Management Agent dialog box, in Management agent run profiles, click the run profile that you want to compile into an executable file, and then click Script.

  5. In the Save as dialog box, type a name and location for the script.

  6. In the Save as type drop-down list, click C# Files.

Note:
The compiler can create an executable file only from a C# file. The compiler cannot create an executable file from a Visual Basic script (.vbs) file.

After you create the C# source file for a run profile, you can use the compiler to compile the source file into an executable file that you can run as a stand-alone file.

To create an executable file from the source file

  1. Open a Command Prompt window, and browse to the location of your source file.

  2. At the command prompt, type csc <source file name>, and then press ENTER.

The compiler creates an executable file of the same name as your source file. For more information about the compiler, see Building From the Command Line.

See Also