summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorRui <ritchxu@gmail.com>2018-12-03 15:33:51 -0500
committerVitek Karas <vitek.karas@microsoft.com>2018-12-03 12:33:51 -0800
commitf8b4745ae754774ebf2a802ef1fd1f2bf6dbd024 (patch)
tree634171b1743a0f67a61c1f8104ceb3b77de871e5 /Documentation
parent940ed217fd424f645227acd3d9fac0caf28ec47b (diff)
downloadcoreclr-f8b4745ae754774ebf2a802ef1fd1f2bf6dbd024.tar.gz
coreclr-f8b4745ae754774ebf2a802ef1fd1f2bf6dbd024.tar.bz2
coreclr-f8b4745ae754774ebf2a802ef1fd1f2bf6dbd024.zip
Clarify use of LoadFromAssemblyName method (#21256)
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/design-docs/assemblyloadcontext.md10
1 files changed, 8 insertions, 2 deletions
diff --git a/Documentation/design-docs/assemblyloadcontext.md b/Documentation/design-docs/assemblyloadcontext.md
index b888510092..cf6c92cda1 100644
--- a/Documentation/design-docs/assemblyloadcontext.md
+++ b/Documentation/design-docs/assemblyloadcontext.md
@@ -68,7 +68,13 @@ This method should be overriden in a *Custom LoadContext* if the intent is to ov
### LoadFromAssemblyName
-This method can be used to load an assembly into a load context different from the load context of the currently executing assembly.
+This method can be used to load an assembly into a load context different from the load context of the currently executing assembly. The assembly will be loaded into the load context on which the method is called. If the context can't resolve the assembly in its **Load** method the assembly loading will defer to the **Default** load context. In such case it's possible the loaded assembly is from the **Default** context even though the method was called on a non-default context.
+
+Calling this method directly on the **AssemblyLoadContext.Default** will only load the assembly from the **Default** context. Depending on the caller the **Default** may or may not be different from the load context of the currently executing assembly.
+
+This method does not "forcefully" load the assembly into the specified context. It basically initiates a bind to the specified assembly name on the specified context. That bind operation will go through the full binding resolution logic which is free to resolve the assembly from any context (in reality the most likely outcome is either the specified context or the default context). This process is described above.
+
+To make sure a specified assembly is loaded into the specified load context call **AssemblyLoadContext.LoadFromAssemblyPath** and specify the path to the assembly file.
### Resolving
@@ -83,4 +89,4 @@ As part of .NET Standard 2.0 effort, certain assembly load APIs off the **Assemb
* Assembly.LoadFile - creates a new (anonymous) load context to load the assembly into.
* Assembly.Load(byte[]) - creates a new (anonymous) load context to load the assembly into.
-If you need to influence the load process or the load context in which assemblies are loaded, please look at the various Load* APIs exposed by **AssemblyLoadContext** [API surface](https://github.com/dotnet/corefx/blob/master/src/System.Runtime.Loader/ref/System.Runtime.Loader.cs). \ No newline at end of file
+If you need to influence the load process or the load context in which assemblies are loaded, please look at the various Load* APIs exposed by **AssemblyLoadContext** [API surface](https://github.com/dotnet/corefx/blob/master/src/System.Runtime.Loader/ref/System.Runtime.Loader.cs).