New to Telerik Reporting? Download free 30-day trial

assemblyReferences Element Overview

Defines a collection of assembly references used by the Reporting Engine during the processing stage to resolve names of user functions, user aggregate functions, and types used by the ObjectDataSource component and Report Event Handlers.

The types from the assemblies included in the assemblyReferences element do not need to be registered explicitly in the typeReferences Element as all types in the assembly will be permitted to be used by the Reporting Engine.

XML-based configuration file:

<assemblyReferences>
    <add />
    <clear />
    <remove />
</assemblyReferences>

JSON-based configuration file:

"assemblyReferences": [
],

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes None
Child Elements
  • add - Optional element. Adds an assembly reference to the collection.
  • clear - Optional element. Removes all references to inherited assembly names, allowing only the references that are added by the current add element.
  • remove - Optional element. Removes a reference to an inherited assembly name from the collection.
Parent Elements
  • configuration - Specifies the root element in every configuration file that is used by the common language runtime and the .NET Framework applications.
  • Telerik.Reporting - Configures all settings that Telerik Reporting Engine uses.

When providing the Public Key Token, the Reporting Engine will try to match it with the Public Key Token of the found DLL. It will not load an assembly with the same name and a different Public Key Token and will throw an exception instead. If the Public Key Token is omitted in the configuration, the Reporting Engine will load the first DLL, whose name matches the provided Assembly Name. Potentially, this may allow bad agents to replace trusted assemblies with malicious ones and constitutes a security vulnerability. Since the Public Key Token provides an extra security layer to your application, we advise to always include it in the configuration file.

In the assemblyReferences element name attribute, you may specify the full path to the DLL file, and the Reporting Engine will load it if it finds it there. In this case, the rest of the attributes (version, culture, and publicKeyToken) will be ignored by the target framework (.NET or .NET Frameworks) functionality we use in our code. This may be a security concern, as explained above, so you need to ensure the assembly on the path is a trusted one.

Example

The following code example demonstrates how to configure the reporting engine to use MyUserFunctionsAssembly assembly as a source for user functions. In this example, it would also search for assemblies in MyDir and SubDir application base sub-directories as we have explicitly instructed via the <probing> Element. This is not mandatory, and when not specified, it will search in the application base, which is the root location where the application is being executed.

The probing element is not supported in the .NET Standalone Designer

XML-based configuration file:

<?xml version="1.0"?>
<configuration>
    <configSections>
        <section name="Telerik.Reporting" type="Telerik.Reporting.Configuration.ReportingConfigurationSection, Telerik.Reporting" allowLocation="true" allowDefinition="Everywhere" />
    </configSections>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
              <probing privatePath="MyDir; MyDir2\SubDir"/>
        </assemblyBinding>
    </runtime>
    <Telerik.Reporting>
        <assemblyReferences>
            <add name="MyUserFunctionsAssembly" version="1.0.0.0" culture="neutral" publicKeyToken ="null" />
        </assemblyReferences>
    </Telerik.Reporting>
...
</configuration>

JSON-based configuration file:

"telerikReporting": {
    "assemblyReferences": [
        {
            "name": "MyUserFunctionsAssembly",
            "version": "1.0.0.0",
            "culture": "neutral",
            "publicKeyToken": "null"
        }
    ]
}

When adding the Telerik.Reporting section manually, do not forget to register it in configSections element of the configuration file. Failing to do so will result in a ConfigurationErrorsException with the following text: Configuration system failed to initialize.