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.v24.2.dll
Declaration
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