This documentation is archived and is not being maintained.

AppDomain.ReflectionOnlyAssemblyResolve Event

Updated: December 2009

Occurs when the resolution of an assembly fails in the reflection-only context.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

public event ResolveEventHandler ReflectionOnlyAssemblyResolve

In the reflection-only context, dependencies are not resolved automatically. They must be preloaded or returned by the handler for this event. This event is raised when an assembly has a dependency that is not already loaded into the reflection-only context. The missing dependency is specified by the ResolveEventArgs.Name property. The ResolveEventHandler for this event must return an assembly that satisfies the dependency. The assembly that is returned must be loaded into the reflection-only context.

Important noteImportant Note:

This event is raised only for missing dependencies of the assembly that you are loading into the reflection-only context (for example, by using the Assembly.ReflectionOnlyLoad method). It is not raised if the assembly that you are loading cannot be found.

For this event, the ResolveEventArgs.Name property returns the assembly name before policy is applied.

To register an event handler for this event, you must have the required permissions, or a SecurityException is thrown.

For more information about handling events, see Consuming Events.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0




December 2009

Clarification: The returned assembly must be loaded into the reflection-only context.

Customer feedback.

December 2009

Clarification: This event is not raised if the assembly that is being loaded is not found; it is raised only if the assembly's dependencies are not found.

Customer feedback.