The PreMark Editor allows you to configure watermarking for protected assemblies.
From this editor, you can:
- Select assemblies for watermarking
- Configure watermark encryption
- Select a character map
- Define the watermark string
- Configure behavior when a watermark exceeds available space
Selecting Assemblies
The left pane displays the assemblies included in the current configuration.
To watermark an assembly:
- Locate the assembly in the assembly list.
- Select the checkbox next to the assembly.
- Save your configuration.
Only selected assemblies receive the configured watermark.
Watermark String
The Watermark String field contains the text that Dotfuscator embeds into the selected assemblies.
Examples include:
- Copyright notices
- Customer identifiers
- Build identifiers
- License information
When entering a watermark string, the editor validates the characters against the selected character map.
If a character is not supported by the current character map, the editor displays a notification.
Character Map
A character map determines how the watermark string is encoded before it is embedded into an assembly.
| Character Map | Description | Bits per Character |
|---|---|---|
| 4bit-a | Hexadecimal | 4 |
| 6bit-a | Uppercase alphanumeric and symbols | 6 |
| 6bit-b | Alphanumeric | 6 |
| 7bit-a | Alphanumeric and symbols | 7 |
| UTF-8 | Any character | Variable |
Smaller encodings allow longer watermark strings to fit into an assembly.
Select UTF-8 when support for arbitrary characters is required.
Encryption Options
The editor can encrypt the watermark before embedding it.
To enable encryption:
- Select Encrypt using Passphrase.
- Enter a passphrase.
When encryption is enabled:
- The watermark is encrypted before embedding.
- The same passphrase is required when extracting the watermark.
- The watermark may consume additional space within the assembly.
Watermark Size Handling
Dotfuscator cannot determine whether a watermark will fit until the assembly is processed.
The When Watermark String is Too Big option controls how Dotfuscator responds when the watermark exceeds available space.
| Option | Description |
|---|---|
| Truncate and Warn | Shortens the watermark and issues a warning. |
| Halt Build | Stops the build and reports an error. |
The warning or error message indicates the maximum watermark size available for the assembly.
Best Practices
- Use meaningful identifiers in watermark strings.
- Choose the smallest character map that supports the required character set.
- Enable encryption for sensitive watermark information.
- Configure builds to fail when truncation would make the watermark unusable.
- Validate watermark extraction before distributing protected assemblies.