AppDomain.ResourceResolve AppDomain.ResourceResolve AppDomain.ResourceResolve AppDomain.ResourceResolve Event

定义

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

public:
 virtual event ResolveEventHandler ^ ResourceResolve;
[add: System.Security.SecurityCritical]
[remove: System.Security.SecurityCritical]
public event ResolveEventHandler ResourceResolve;
member this.ResourceResolve : ResolveEventHandler 
Public Custom Event ResourceResolve As 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 4,则ResolveEventArgs.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.

安全性

SecurityCriticalAttribute
直接调用方需要完全信任。requires full trust for the immediate caller. 不能由部分受信任的或透明的代码使用此成员。This member cannot be used by partially trusted or transparent code.

适用于

另请参阅