You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<paramname="context">The metadata load context object that represents the closed universe of <seecref="T:System.Type" /> objects loaded for inspection-only purposes.</param>
58
+
<paramname="assemblyName">The name of the assembly.</param>
59
+
<summary>Returns an assembly from a given assembly name.</summary>
60
+
<returns>The assembly for the provided <paramrefname="assemblyName" />.</returns>
61
+
<remarks>
62
+
<formattype="text/markdown">
63
+
<![CDATA[
64
+
65
+
## Remarks
66
+
67
+
Binding an assembly name to an assembly occurs when <xref:System.Reflection.MetadataLoadContext.LoadFromAssemblyName%2A> is called or when a type from one assembly has a dependency on another assembly. The handler that overrides `Resolve` should use <xref:System.Reflection.MetadataLoadContext.LoadFromStream%2A?displayProperty=nameWithType>, <xref:System.Reflection.MetadataLoadContext.LoadFromAssemblyPath%2A?displayProperty=nameWithType> or <xref:System.Reflection.MetadataLoadContext.LoadFromByteArray%2A?displayProperty=nameWithType> to load the requested assembly and return it.
68
+
69
+
To indicate the failure to find an assembly, the handler should return `null` rather than throwing an exception. Returning `null` commits the failure so that future attempts to load that name will fail without re-invoking the handler.
70
+
71
+
If the handler throws an exception, the exception will be passed through to the application that invoked the operation that triggered the binding. The <xref:System.Reflection.MetadataLoadContext> will not catch it, and no binding will occur.
72
+
73
+
The handler will generally not be called more than once for the same name, unless two threads race to load the same assembly. Even in that case, one result will win and be atomically bound to the name.
74
+
75
+
The <xref:System.Reflection.MetadataLoadContext> intentionally performs no ref-def matching on the returned assembly as what constitutes a ref-def match is a policy. It is also the kind of arbitrary restriction that <xref:System.Reflection.MetadataLoadContext> strives to avoid.
76
+
77
+
The <xref:System.Reflection.MetadataLoadContext> cannot consume assemblies from other metadata load contexts or other type providers (such as the underlying runtime's own reflection system). If a handler returns such an assembly, the <xref:System.Reflection.MetadataLoadContext> throws a <xref:System.IO.FileLoadException>.
Copy file name to clipboardExpand all lines: xml/System.Reflection/PathAssemblyResolver.xml
+36-10Lines changed: 36 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -14,8 +14,24 @@
14
14
</Base>
15
15
<Interfaces />
16
16
<Docs>
17
-
<summary>To be added.</summary>
18
-
<remarks>To be added.</remarks>
17
+
<summary>Represents a metadata assembly resolver that uses paths to every assembly that may be loaded.</summary>
18
+
<remarks>
19
+
<formattype="text/markdown">
20
+
<![CDATA[
21
+
22
+
## Remarks
23
+
24
+
The file name is expected to be the same as the assembly's simple name. Multiple assemblies can exist on disk with the same name but in different directories. A single instance of `PathAssemblyResolver` can be used with multiple <xref:System.Reflection.MetadataAssemblyResolver> instances.
25
+
26
+
In order for an <xref:System.Reflection.AssemblyName> to match a loaded assembly, <xref:System.Reflection.AssemblyName.Name?displayProperty=nameWithType> must be equal (casing ignored).
27
+
28
+
* If a public key token is specified for the <xref:System.Reflection.AssemblyName>, it must be equal.
29
+
* If a public key token is not specified for <xref:System.Reflection.AssemblyName>, assemblies with no public key token are selected over those with a public key token.
30
+
* If more than one assembly matches, the assembly with the highest <xref:System.Reflection.AssemblyName.Version?displayProperty=nameWithType> is returned.
31
+
* <xref:System.Reflection.AssemblyName.CultureName?displayProperty=nameWithType> is ignored.
<paramname="context">The metadata load context object that represents the closed universe of <seecref="System.Type" /> objects loaded for inspection-only purposes.</param>
80
+
<paramname="assemblyName">The name of the assembly.</param>
81
+
<summary>Returns an assembly from a given assembly name.</summary>
82
+
<returns>The assembly for the provided <paramrefname="assemblyName" />.</returns>
83
+
<remarks>
84
+
<formattype="text/markdown"><![CDATA[
85
+
86
+
## Remarks
87
+
88
+
See the <xref:System.Reflection.MetadataAssemblyResolver> remarks for more information.
0 commit comments