Getting Started
NServiceBus
Transports
Persistence
ServiceInsight
ServicePulse
ServiceControl
Monitoring
Previews
Samples

Assembly loading

Component: NServiceBus

Assembly scanning

NServiceBus relies on assembly scanning to detect and load user-defined extension points into the endpoint. Depending on the assembly scanning configuration, endpoints will automatically load assemblies deployed to the configured probing paths. This behavior implies a high level of trust in assemblies being deployed along with the application and appropriate infrastructure configuration to prevent foreign access to the applications binary folders (e.g., using file system permissions and appropriate system accounts).

Dynamic type loading

Due to the various ways of defining, sharing, and deploying message contracts, a specific message type might not be available or detected by assembly scanning at startup time. NServiceBus is capable of automatically loading message types, including their defining assembly, at runtime if it is present in the .NET runtime's assembly probing paths. This behavior can lead to additional assemblies being loaded during runtime, based on incoming messages NServiceBus.EnclosedMessageTypes header.

Loading types does not automatically create instances of the loaded type. NServiceBus prevents instantiation of types that are not considered valid message types.

Related Articles

  • Assembly scanning
    To enable automatic detection of various features NServiceBus scans assemblies for well known types.
  • Security
    Security features for messages, transports, and persisters.

Last modified