Skip to main content
All docs
V25.1
  • BindToTypePolicy.DenyAssemblyLoadingFromFilesAndBytes() Method

    Prevents DevExpress UI controls from loading assemblies from arbitrary paths and Byte arrays (Assembly.LoadFile(String), Assembly.Load(Byte[])).

    Namespace: DevExpress.Utils

    Assembly: DevExpress.Data.v25.1.dll

    NuGet Package: DevExpress.Data

    Declaration

    public static void DenyAssemblyLoadingFromFilesAndBytes()

    Remarks

    Call the DenyAssemblyLoadingFromFilesAndBytes method at application startup to apply a restrictive policy.

    static void Main() {
        DevExpress.Data.BindToTypePolicy.DenyAssemblyLoadingFromFilesAndBytes();  
        Application.Run(new Form1());  
    }
    

    You can also handle the QueryAssemblyLoad event to spot an “unknown” assembly before it is loaded, check its name, and allow or cancel the operation.

    Read the following topic for more information and examples: Safe Deserialization – How to Resolve Unknown Assembly Loads.

    See Also