Skip to content

Commit 3610c3e

Browse files
committed
Attempt to fix up problems
1 parent 38029a8 commit 3610c3e

File tree

1 file changed

+15
-35
lines changed

1 file changed

+15
-35
lines changed

xml/System.Reflection/Assembly.xml

Lines changed: 15 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -4041,6 +4041,9 @@ This property is marked obsolete starting in .NET 5, and generates a compile-tim
40414041
<format type="text/markdown"><![CDATA[
40424042

40434043
## Remarks
4044+
4045+
In .NET Core 2.0 and later, the target assembly will be loaded into the current <xref:System.Reflection.AssemblyLoadContext>. For more information on assembly loading, see <see cref="https://learn.microsoft.com/en-us/dotnet/core/dependency-loading/loading-managed#algorithm" />.
4046+
40444047
<xref:System.IO.FileLoadException> is thrown if `assemblyRef` specifies the full assembly name and the first assembly that matches the simple name has a different version, culture, or public key token. The loader does not continue probing for other assemblies that match the simple name. Starting with .NET Framework 4, because execution of code in remote assemblies is disabled by default, a <xref:System.IO.FileLoadException> is also thrown if `assemblyRef` specifies a remote assembly. To enable execution of code loaded from remote locations, you can use the [`<loadFromRemoteSources>`](/dotnet/framework/configure-apps/file-schema/runtime/loadfromremotesources-element) configuration element.
40454048

40464049
> [!NOTE]
@@ -4128,20 +4131,13 @@ Note: In <see href="https://go.microsoft.com/fwlink/?LinkID=247912">.NET for Win
41284131
<param name="assemblyString">The long or short form of the assembly name.</param>
41294132
<summary>Loads an assembly with the specified name.</summary>
41304133
<returns>The loaded assembly.</returns>
4131-
<remarks FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0">
4134+
<remarks>
41324135
<format type="text/markdown"><![CDATA[
41334136

41344137
## Remarks
41354138

4136-
This API is present in .NET Core for compatibility, but it is recommended to use <xref:System.Reflection.AssemblyLoadContext> overloads in .NET Core 2.0 and later.
4137-
4138-
The assembly is loaded into the current AssemblyLoadContext.
4139-
]]></format>
4140-
</remarks>
4141-
<remarks FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1netframework-4.8.1">
4142-
<format type="text/markdown"><![CDATA[
4139+
In .NET Core 2.0 and later, the target assembly will be loaded into the current <xref:System.Reflection.AssemblyLoadContext>. For more information on assembly loading, see <see cref="https://learn.microsoft.com/en-us/dotnet/core/dependency-loading/loading-managed#algorithm" />.
41434140

4144-
## Remarks
41454141
To load the correct assembly, it's recommended to call the `Load` method by passing the long form of the assembly name. The long form of an assembly name consists of its simple name (such as "System" for the System.dll assembly) along with its version, culture, public key token, and optionally its processor architecture. It corresponds to the assembly's <xref:System.Reflection.Assembly.FullName%2A> property. The following example illustrates the use of a long name to load the System.dll assembly for the .NET Framework 4:
41464142

41474143
:::code language="csharp" source="~/snippets/csharp/System.Reflection/Assembly/Load/load11.cs" id="Snippet1":::
@@ -4241,20 +4237,12 @@ To load the correct assembly, it's recommended to call the `Load` method by pass
42414237
<param name="rawSymbolStore">A byte array that contains the raw bytes representing the symbols for the assembly.</param>
42424238
<summary>Loads the assembly with a common object file format (COFF)-based image containing an emitted assembly, optionally including symbols for the assembly.</summary>
42434239
<returns>The loaded assembly.</returns>
4244-
<remarks FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0">
4240+
<remarks>
42454241
<format type="text/markdown"><![CDATA[
42464242

42474243
## Remarks
42484244

4249-
This API is present in .NET Core for compatibility, but it is recommended to use <xref:System.Reflection.AssemblyLoadContext> overloads in .NET Core 2.0 and later.
4250-
4251-
The assembly is loaded into the current AssemblyLoadContext.
4252-
]]></format>
4253-
</remarks>
4254-
<remarks FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1netframework-4.8.1">
4255-
<format type="text/markdown"><![CDATA[
4256-
4257-
## Remarks
4245+
In .NET Core 2.0 and later, the target assembly will be loaded into the current <xref:System.Reflection.AssemblyLoadContext>. For more information on assembly loading, see <see cref="https://learn.microsoft.com/en-us/dotnet/core/dependency-loading/loading-managed#algorithm" />.
42584246

42594247
This method overload always creates a new <xref:System.Reflection.Assembly> object in its own isolated load context.
42604248

@@ -4640,20 +4628,15 @@ The assembly is loaded using the supplied evidence. The raw bytes representing t
46404628
<param name="path">The fully qualified path of the file to load.</param>
46414629
<summary>Loads the contents of an assembly file on the specified path.</summary>
46424630
<returns>The loaded assembly.</returns>
4643-
<remarks FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0">
4631+
<remarks>
46444632
<format type="text/markdown"><![CDATA[
46454633

46464634
## Remarks
46474635

4648-
This API is present in .NET Core for compatibility, but it is recommended to use <xref:System.Reflection.AssemblyLoadContext> overloads in .NET Core 2.0 and later.
4636+
This API is present in .NET Core for compatibility, but it is recommended to use <xref:System.Reflection.AssemblyLoadContext> overloads in .NET Core 2.0 and later.
46494637

4650-
The assembly is loaded into a new AssemblyLoadContext created for this purpose.
4651-
]]></format>
4652-
</remarks>
4653-
<remarks FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1netframework-4.8.1">
4654-
<format type="text/markdown"><![CDATA[
4638+
The assembly is loaded into a new AssemblyLoadContext created for this purpose. For more information on assembly loading, see <see cref="https://learn.microsoft.com/en-us/dotnet/core/dependency-loading/loading-managed#algorithm" />.
46554639

4656-
## Remarks
46574640
Use the <xref:System.Reflection.Assembly.LoadFile%2A> method to load and examine assemblies that have the same identity, but are located in different paths. <xref:System.Reflection.Assembly.LoadFile%2A> does not load files into the load-from context, and does not resolve dependencies using the load path, as the <xref:System.Reflection.Assembly.LoadFrom%2A> method does. <xref:System.Reflection.Assembly.LoadFile%2A> is useful in this limited scenario because <xref:System.Reflection.Assembly.LoadFrom%2A> cannot be used to load assemblies that have the same identities but different paths; it will load only the first such assembly.
46584641

46594642
Starting with .NET Framework 4, if `path` specifies an assembly in a remote location, assembly loading is disabled by default, and the `LoadFile` method throws a <xref:System.IO.FileLoadException>. To enable execution of code loaded from remote locations, you can use the [`<loadFromRemoteSources>`](/dotnet/framework/configure-apps/file-schema/runtime/loadfromremotesources-element) configuration element.
@@ -4820,22 +4803,19 @@ Starting with .NET Framework 4, the ability to execute code in assemblies loaded
48204803
<param name="assemblyFile">The name or path of the file that contains the manifest of the assembly.</param>
48214804
<summary>Loads an assembly given its file name or path.</summary>
48224805
<returns>The loaded assembly.</returns>
4823-
<remarks FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;net-5.0;net-6.0;net-7.0;net-8.0;net-9.0">
4806+
<remarks>
48244807
<format type="text/markdown"><![CDATA[
48254808

48264809
## Remarks
48274810

4828-
This API is present in .NET Core for compatibility, but it is recommended to use <xref:System.Reflection.AssemblyLoadContext> overloads in .NET Core 2.0 and later.
4811+
This API is present in .NET Core for compatibility, but it is recommended to use <xref:System.Reflection.AssemblyLoadContext> overloads in .NET Core 2.0 and later.
48294812

4830-
The assembly is loaded into the default AssemblyLoadContext.
4831-
]]></format>
4832-
</remarks>
4833-
<remarks FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1netframework-4.8.1">
4834-
<format type="text/markdown"><![CDATA[
4813+
The assembly is loaded into the default AssemblyLoadContext. For more information on assembly loading, see <see cref="https://learn.microsoft.com/en-us/dotnet/core/dependency-loading/loading-managed#algorithm" />.
48354814

4836-
## Remarks
48374815
The `assemblyFile` parameter must refer to a URI without escape characters. This method supplies escape characters for all invalid characters in the URI.
48384816

4817+
Before .NET 5, the following applied:
4818+
48394819
> [!NOTE]
48404820
> File transfer protocol (FTP) is not supported. If the URI supplied for `assemblyFile` is an FTP address, the assembly is not loaded. No exception is thrown.
48414821

0 commit comments

Comments
 (0)