Getting Started
Architecture
NServiceBus
Transports
Persistence
ServiceInsight
ServicePulse
ServiceControl
Monitoring
Samples

Assembly loading

Component: NServiceBus
NuGet Package: NServiceBus (8.x)

Assembly scanning

NServiceBus relies on assembly scanning to detect and load user-defined extension points into the endpoint. Depending on the 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 application's binary folders (e.g., using file system permissions and appropriate system accounts).

Assembly scanning can be configured to completely prevent automatic loading of assemblies from the file system.

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 assemblies, at runtime if they are present in the .NET runtime's assembly probing paths. This behavior can lead to additional assemblies being loaded during runtime, based on the NServiceBus.EnclosedMessageTypes header of incoming messages.

Dynamic type loading can be disabled via the serializer configuration.

Related Articles

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