TypeReferences Element Overview
This element was first introduced in the 2024 Q1 (18.0.24.305) Reporting version.
Defines a collection of type references used by the Reporting Engine to resolve the custom types permitted to be used during the design and processing stages. The assemblies used by the types in the TypeReferences
section are loaded into the application domain if the type is successfully resolved, so it's not necessary to also declare the assembly in the assemblyReferences
section.
XML-based configuration file:
JSON-based configuration file:
The TypeReferences
element was introduced to let you allow only specific types from restricted assemblies, i.e., assemblies not listed in the assemblyReferences
element.
If you want to allow all the types from a DLL, use the assemblyReferences element. instead.
Attributes and Elements
The following sections describe attributes, child elements, and parent elements.
Attributes |
|
Child Elements |
|
Parent Elements |
|
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, which 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.
Example
The following code example demonstrates how to configure the Reporting Engine to use the MyNamespace.MyClassName
type from the MyAssemblyName
assembly, which has a public key token with the value my-assembly-public-key-token
. If the type is correctly resolvable at runtime, it will be permitted to be used as a source for the ObjectDataSource's data retrieval. This configuration element also allows listing custom types that are allowed in the report definition.
XML-based configuration file:
JSON-based configuration file:
When adding the
Telerik.Reporting
section manually, do not forget to register it inconfigSections
element of the configuration file. Failing to do so will result in a ConfigurationErrorsException with the following text: Configuration system failed to initialize.