Using your own key file

By default, when you build the assembly, xfNetLink .NET generates public and private keys in a strong name key file (.snk file) named with the assembly name. These keys are then used to sign the assembly when you build your project in Visual Studio.

If signing is not a concern for your application, you can simply use the defaults (i.e., do nothing in this regard). It is likely, however, that your company will want to develop a policy for signing assemblies. In this case, you will need to create your own key file and specify it when you create the assembly (see the steps below).

Depending on your workflow, you may want to use delayed signing. Delayed signing assigns the public key when the assembly is built, but enables you to delay the assignment of the private key until you are ready to distribute the assembly. You can use delayed signing for your Synergy assembly only when you use your own key file.

To use your own key file

1. Before generating C# classes, create an .snk file using Microsoft’s Strong Name tool, sn.exe, which is included in the .NET Framework.
2. If you are creating the assembly in Workbench, enter the name of your key file in the “Key file” field in the Component Information dialog box for your project. If you want to delay sign the assembly, also check the “Delay sign assembly” option. See Creating a Synergy/DE .NET Component project for details.
3. If you are creating the assembly from the command line, when you run gencs, specify the key file name with the ‑s option. If you want to delay sign the assembly, also specify the ‑t option. See Generating C# classes with gencs.

A complete discussion of strong naming and delayed signing is beyond the scope of this manual. For additional information, and for instructions on using sn.exe to create a key file, see your .NET documentation.