AppDomain.ResourceResolve Event

Definition

Occurs when the resolution of a resource fails because the resource is not a valid linked or embedded resource in the assembly.

C#
public event ResolveEventHandler? ResourceResolve;
C#
public event ResolveEventHandler ResourceResolve;
C#
[add: System.Security.SecurityCritical]
[remove: System.Security.SecurityCritical]
public event ResolveEventHandler ResourceResolve;

Event Type

Implements

Attributes

Remarks

The ResolveEventHandler for this event can attempt to locate the assembly containing the resource and return it.

Important

This event is not raised if resolution fails because no file can be found for a valid linked resource. It is raised if a manifest resource stream cannot be found, but it is not raised if an individual resource key cannot be found.

Beginning with the .NET Framework 4, the ResolveEventArgs.RequestingAssembly property contains the assembly that requested the resource. For more information, see ResolveEventArgs.RequestingAssembly.

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 Handling and Raising Events.

Applies to

Product Versions
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

See also