AppDomain.ReflectionOnlyAssemblyResolve Event
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Occurs when the resolution of an assembly fails in the reflection-only context.
public:
event ResolveEventHandler ^ ReflectionOnlyAssemblyResolve;
public event ResolveEventHandler? ReflectionOnlyAssemblyResolve;
public event ResolveEventHandler ReflectionOnlyAssemblyResolve;
[add: System.Security.SecurityCritical]
[remove: System.Security.SecurityCritical]
public event ResolveEventHandler ReflectionOnlyAssemblyResolve;
member this.ReflectionOnlyAssemblyResolve : ResolveEventHandler
[<add: System.Security.SecurityCritical>]
[<remove: System.Security.SecurityCritical>]
member this.ReflectionOnlyAssemblyResolve : ResolveEventHandler
Public Custom Event ReflectionOnlyAssemblyResolve As ResolveEventHandler
Public Event ReflectionOnlyAssemblyResolve As ResolveEventHandler
Event Type
- Attributes
Remarks
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
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.
Beginning with the .NET Framework 4, the ResolveEventArgs.RequestingAssembly property returns the assembly that requested the assembly load that could not be resolved. Knowing the identity of the requesting assembly might be useful in identifying the correct version of the dependency, if more than one version is available. For more information, see ResolveEventArgs.RequestingAssembly.
For this event, the ResolveEventArgs.Name property returns the assembly name before policy is applied.
For more information about handling events, see Handling and Raising Events.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기