Skip to content

Commit 659f623

Browse files
Copilotelinor-fung
andauthored
docs: document FileNotFoundException passthrough behavior in AssemblyLoadContext resolution chain (#12419)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: elinor-fung <47805090+elinor-fung@users.noreply.github.com>
1 parent f2616dd commit 659f623

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

xml/System.Runtime.Loader/AssemblyLoadContext.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,9 @@ Implementations of this method can return an assembly loaded into any <xref:Syst
586586
> [!IMPORTANT]
587587
> To prevent recursive stack overflow, do not call this instance's <xref:System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyName(System.Reflection.AssemblyName)> method from this method.
588588
589+
> [!NOTE]
590+
> If this method throws a <xref:System.IO.FileNotFoundException>, the resolution process continues. The <xref:System.Runtime.Loader.AssemblyLoadContext.Resolving> event and the <xref:System.AppDomain.AssemblyResolve> event are still fired. Any other exception stops the resolution process immediately.
591+
589592
]]></format>
590593
</remarks>
591594
<related type="Article" href="/dotnet/core/dependency-loading/loading-managed">Managed assembly loading algorithm</related>
@@ -1108,6 +1111,9 @@ The OS handle returned by this method can be used with methods of the <xref:Syst
11081111
> [!IMPORTANT]
11091112
> If more than one event handler is registered for this event, the event handlers are called in order until an event handler returns a value that isn't `null`. Subsequent event handlers are ignored.
11101113
1114+
> [!NOTE]
1115+
> If an event handler throws a <xref:System.IO.FileNotFoundException>, the <xref:System.AppDomain.AssemblyResolve> event is still fired. This gives other extension points a chance to resolve the assembly. Any other exception stops the resolution process immediately and isn't propagated to other handlers.
1116+
11111117
For more information about handling events, see [Handle and raise events](/dotnet/standard/events/).
11121118
11131119
It is noteworthy that a handler can be added for this event on any <xref:System.Runtime.Loader.AssemblyLoadContext>, including the default context.

0 commit comments

Comments
 (0)