Dotfuscator User's Guide
Linked Assemblies

A <linkedassembly> element specifies that one or more input assemblies should be linked into a specified output assembly. The linking section can contain multiple <linkedassembly> elements; therefore, you can use the linker to create multiple output assemblies. The only limitation is that you cannot link the same input assembly into multiple output assemblies.

The <linkedassembly> element contains sub-elements that allow you to specify options for the link step, such as the name mangling policy, the primary assembly, the list of input assemblies, and the name of the output assembly.

Options

Currently the only option you can specify is the name mangling policy, which may be one of:

Primary Assembly

The <primaryinput> element identifies the prime assembly whose manifest information is used to create the output assembly’s manifest. This assembly must also be listed in the subsequent <assemblylist> element.

Assemblies to Link

The assemblies you want to link are listed using an <assemblylist> element. Each must also be listed as an input assembly.

Output Assembly

The <outputassembly> element allows you to specify a name for the output assembly and an optional entry point method. The assembly is written to the destination directory with the given name.

Example

The example <linkedassembly> element specifies that input assemblies Driver.exe and LibraryC.dll should be linked into an assembly named out.exe. The entry point method is explicitly set to the Main method in the Driver assembly.

Note: An entry point only needs to be explicitly specified in ambiguous cases. For example, the output assembly is an .exe and the input assemblies contain more than one entry point.
Linked Assembly
Copy Code
    <linkedassembly>
      <option>donotmangle</option>
      <primaryinput>
        <assembly>
          <file dir="${configdir}" name="Driver.exe" />
        </assembly>
      </primaryinput>
      <assemblylist>
        <assembly>
          <file dir="${configdir}" name="Driver.exe" />
        </assembly>
        <assembly>
          <file dir="${configdir}" name="LibraryC.dll" />
        </assembly>
      </assemblylist>
      <outputassembly name="out.exe">
        <entrypoint>
          <type name="Driver.Form1">
            <method name="Main" signature="" />
          </type>
        </entrypoint>
      </outputassembly>
    </linkedassembly>

See Also

Linking

 

 


© 2016 PreEmptive Solutions, LLC. All Rights Reserved.

www.preemptive.com