ArmDot can embed files into protected assembly.
⚠ This feature is available on Windows only.
For example, you might need to merge unmanaged DLLs into your application in order to distribute a single executable file. Also, you can hide and protect assets: media files, images, configuration files, databases, etc.
The assembly reads and writes to such a file as if it really exists on a disk. At the same time, embedded files are not saved to a disk, but instead are located in process memory.
There are two ways to embed files: a declarative way (using a special attribute, ArmDot.Client.EmbedFileAttribute), or using the ArmDot UI.
Embedding files by a declarative way
To embed a file this way, use ArmDot.Client.EmbedFileAttribute, instructing ArmDot where to get content of the file, and what is a runtime path of the file.
Runtime path can be a full path, but usually it consists of a predefined directory id and a relative path, that allows to place a file to the assembly directory, or to some system directory:
// AssemblyInfo.cs using ArmDot.Client; [assembly: EmbedFile(SourcePath: "file_content.txt", RuntimePath: @"$(AssemblyDirectory)\embedded_file.txt")]
You can find a complete ready to use sample on GitHub: https://github.com/Softanics/armdot-sample-embed-file
Embedding files using the ArmDot UI
Switch to Files in the ArmDot UI:
Here the predefined folders at the right, like Assembly Directory and System Drive.
To include a file to a protected assembly click to Add Files... and choose a file. Another option is to import an entire directory.
Possible file / directory type is Embedded or External. To change it, select a file and change type via Properties at the right from the file tree.
If a directory is not marked as embedded, the protected assembly will view both real files and embedded files from the directory.