AppDomain.ResourceResolve 事件

定义

当资源解析因资源不是程序集中的有效链接资源或嵌入资源而失败时发生。Occurs when the resolution of a resource fails because the resource is not a valid linked or embedded resource in the assembly.

public:
 event ResolveEventHandler ^ ResourceResolve;
public:
 virtual event ResolveEventHandler ^ ResourceResolve;
public event ResolveEventHandler ResourceResolve;
[add: System.Security.SecurityCritical]
[remove: System.Security.SecurityCritical]
public event ResolveEventHandler ResourceResolve;
member this.ResourceResolve : ResolveEventHandler 
[<add: System.Security.SecurityCritical>]
[<remove: System.Security.SecurityCritical>]
member this.ResourceResolve : ResolveEventHandler 
Public Custom Event ResourceResolve As ResolveEventHandler 

事件类型

ResolveEventHandler

实现

属性

注解

ResolveEventHandler此事件的可尝试查找包含该资源的程序集并将其返回。The ResolveEventHandler for this event can attempt to locate the assembly containing the resource and return it.

重要

如果解析失败,则不会引发此事件,因为找不到有效链接资源的文件。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.

从开始 .NET Framework 4.NET Framework 4ResolveEventArgs.RequestingAssembly 属性包含请求资源的程序集。Beginning with the .NET Framework 4.NET Framework 4, the ResolveEventArgs.RequestingAssembly property contains the assembly that requested the resource. 有关详细信息,请参阅 ResolveEventArgs.RequestingAssemblyFor more information, see ResolveEventArgs.RequestingAssembly.

若要为此事件注册事件处理程序,你必须具有所需的权限,否则 SecurityException 将引发。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.

适用于

另请参阅