Installing DLLs

Install DLLs on the website with the DLL package fragment installer

The DllPackageFragmentInstaller can install DLLs file on the website.

If a DLL file with the same name already exists, the installer will overwrite it - but only if the version being installed is newer. The installer also will add or update an assembly binding for the DLL in web.config to ensure that the system will run properly.

The specified DLL files will not be uninstalled automatically to avoid a possible website crash.

The use of this fragment installer can be particularly applicable for public DLLs frequently released by third parties (for example, Microsoft Azure API libraries and the like).

Example:

<mi:Add
    installerType="Composite.Core.PackageSystem.PackageFragmentInstallers.DllPackageFragmentInstaller, Composite"
    uninstallerType="Composite.Core.PackageSystem.PackageFragmentInstallers.DllPackageFragmentUninstaller, Composite">
    <Files>
        <File
            sourceFilename="~\Bin\System.Threading.Tasks.Dataflow.dll"
            targetFilename="~\Bin\System.Threading.Tasks.Dataflow.dll"
            allowOverwrite="true" />
        <File
            sourceFilename="~\Bin\Microsoft.WindowsAzure.Storage.dll"
            targetFilename="~\Bin\Microsoft.WindowsAzure.Storage.dll"
            allowOverwrite="true" />
        <File
            sourceFilename="~\Bin\Microsoft.ServiceBus.dll"
            targetFilename="~\Bin\Microsoft.ServiceBus.dll"
            allowOverwrite="true" />
    </Files>
</mi:Add>
The <Files /> element

The Files element can contain one, or more File elements, which allow you to copy individual DLL files.

The File element has the following attributes:

  • sourceFilename: A tilde-based path that points to a DLL file in the package's ZIP file
  • targetFilename: A tilde-based path that points to a DLL file location on the C1 CMS file structure.
  • allowOverwrite: When “false”, the system will halt installation if the DLL file already exists; otherwise, it will overwrite the file.
  • assemblyLoad: When "true" the assembly will be loaded into memory as part of the installation - this will make types in the assembly available during the install process
  • onlyUpdate: When "true" and the assembly file isn't already present, the assembly will not be installed.
  • addAssemblyBinding: When "true" an assembly binding will be added to ~/web.config for the assembly, redirecting all prior versions to this version.