-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust remarks for Assembly.Load on .NET Core #9764
base: main
Are you sure you want to change the base?
Conversation
Learn Build status updates of commit 38029a8:
|
File | Status | Preview URL | Details |
---|---|---|---|
xml/System.Reflection/Assembly.xml | View | Details |
xml/System.Reflection/Assembly.xml
- Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Reflection.AssemblyLoadContext'.
- Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Reflection.AssemblyLoadContext'.
- Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Reflection.AssemblyLoadContext'.
- Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Reflection.AssemblyLoadContext'.
- Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Reflection.AssemblyLoadContext'.
For more details, please refer to the build report.
Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
For any questions, please:
- Try searching the learn.microsoft.com contributor guides
- Post your question in the Learn support channel
xml/System.Reflection/Assembly.xml
Outdated
|
||
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. | ||
|
||
The assembly is loaded into the default AssemblyLoadContext. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This overload throws NotSupportedException in .NET Core 2.0+:
xml/System.Reflection/Assembly.xml
Outdated
|
||
## Remarks | ||
|
||
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this recommendation for the Assembly.Load overloads that take AssemblyName or assembly name string. I do not think that these overloads are problematic and it is typically fine to use them even in .NET Core 2.0+.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My assumption is that the typical caller of these Assembly.Load overloads wants to load the assembly into its own context. The explicit replacement of Assembly.Load(assemblyName)
is AssemblyLoadContext.GetLoadContext(Assembly.GetExecutingAssembly())!.LoadFromAssemblyName(assemblyName)
that is way more complicated.
xml/System.Reflection/Assembly.xml
Outdated
|
||
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. | ||
|
||
The assembly is loaded into the current AssemblyLoadContext. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
xml/System.Reflection/Assembly.xml
Outdated
@@ -4128,7 +4128,17 @@ Note: In <see href="https://go.microsoft.com/fwlink/?LinkID=247912">.NET for Win | |||
<param name="assemblyString">The long or short form of the assembly name.</param> | |||
<summary>Loads an assembly with the specified name.</summary> | |||
<returns>The loaded assembly.</returns> | |||
<remarks> | |||
<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"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remarks can't be versioned like this unfortunately. You just have to annotate them in the text itself where they are version specific.
@@ -4041,6 +4041,9 @@ This property is marked obsolete starting in .NET 5, and generates a compile-tim | |||
<format type="text/markdown"><![CDATA[ | |||
|
|||
## Remarks | |||
|
|||
In .NET Core 2.0 and later, the target assembly will be loaded into the current <xref:System.Runtime.Loader.AssemblyLoadContext>. For more information on assembly loading, see <see cref="https://learn.microsoft.com/en-us/dotnet/core/dependency-loading/loading-managed#algorithm" />. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In .NET Core 2.0 and later, the target assembly will be loaded into the current <xref:System.Runtime.Loader.AssemblyLoadContext>. For more information on assembly loading, see <see cref="https://learn.microsoft.com/en-us/dotnet/core/dependency-loading/loading-managed#algorithm" />. | |
In .NET Core/5+, the target assembly will be loaded into the current <xref:System.Runtime.Loader.AssemblyLoadContext>. For more information on assembly loading, see <see cref="https://learn.microsoft.com/en-us/dotnet/core/dependency-loading/loading-managed#algorithm" />. |
@@ -4132,6 +4135,9 @@ Note: In <see href="https://go.microsoft.com/fwlink/?LinkID=247912">.NET for Win | |||
<format type="text/markdown"><![CDATA[ | |||
|
|||
## Remarks | |||
|
|||
In .NET Core 2.0 and later, the target assembly will be loaded into the current <xref:System.Runtime.Loader.AssemblyLoadContext>. For more information on assembly loading, see <see cref="https://learn.microsoft.com/en-us/dotnet/core/dependency-loading/loading-managed#algorithm" />. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In .NET Core 2.0 and later, the target assembly will be loaded into the current <xref:System.Runtime.Loader.AssemblyLoadContext>. For more information on assembly loading, see <see cref="https://learn.microsoft.com/en-us/dotnet/core/dependency-loading/loading-managed#algorithm" />. | |
In .NET Core/5+, the target assembly will be loaded into the current <xref:System.Runtime.Loader.AssemblyLoadContext>. For more information on assembly loading, see <see cref="https://learn.microsoft.com/en-us/dotnet/core/dependency-loading/loading-managed#algorithm" />. |
@@ -4236,6 +4242,8 @@ To load the correct assembly, it's recommended to call the `Load` method by pass | |||
|
|||
## Remarks | |||
|
|||
In .NET Core 2.0 and later, the target assembly will be loaded into the current <xref:System.Runtime.Loader.AssemblyLoadContext>. For more information on assembly loading, see <see cref="https://learn.microsoft.com/en-us/dotnet/core/dependency-loading/loading-managed#algorithm" />. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In .NET Core 2.0 and later, the target assembly will be loaded into the current <xref:System.Runtime.Loader.AssemblyLoadContext>. For more information on assembly loading, see <see cref="https://learn.microsoft.com/en-us/dotnet/core/dependency-loading/loading-managed#algorithm" />. | |
In .NET Core/5+, the target assembly will be loaded into the current <xref:System.Runtime.Loader.AssemblyLoadContext>. For more information on assembly loading, see <see cref="https://learn.microsoft.com/en-us/dotnet/core/dependency-loading/loading-managed#algorithm" />. |
The `assemblyFile` parameter must refer to a URI without escape characters. This method supplies escape characters for all invalid characters in the URI. | ||
|
||
Before .NET 5, the following applied: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before .NET 5, the following applied: | |
In .NET Framework, the following applied: |
This API is not supported in .NET Core 2.0 or later. It will always throw <xref:System.NotSupportedException>. | ||
|
||
The assembly is loaded into the default AssemblyLoadContext. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This API is not supported in .NET Core 2.0 or later. It will always throw <xref:System.NotSupportedException>. | |
The assembly is loaded into the default AssemblyLoadContext. | |
This API is not supported in .NET Core/5+. It will always throw <xref:System.NotSupportedException>. | |
Learn Build status updates of commit 3610c3e:
|
File | Status | Preview URL | Details |
---|---|---|---|
xml/System.Reflection/Assembly.xml | View | Details |
xml/System.Reflection/Assembly.xml
- Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Reflection.AssemblyLoadContext'.
- Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Reflection.AssemblyLoadContext'.
- Line 0, Column 0: [Warning: disallowed-html-tag - See documentation]
HTML tag 'see' isn't allowed. Replace it with approved Markdown or escape the brackets if the content is a placeholder.
- Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Reflection.AssemblyLoadContext'.
- Line 0, Column 0: [Warning: disallowed-html-tag - See documentation]
HTML tag 'see' isn't allowed. Replace it with approved Markdown or escape the brackets if the content is a placeholder.
- Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Reflection.AssemblyLoadContext'.
- Line 0, Column 0: [Warning: disallowed-html-tag - See documentation]
HTML tag 'see' isn't allowed. Replace it with approved Markdown or escape the brackets if the content is a placeholder.
- Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Reflection.AssemblyLoadContext'.
- Line 0, Column 0: [Warning: disallowed-html-tag - See documentation]
HTML tag 'see' isn't allowed. Replace it with approved Markdown or escape the brackets if the content is a placeholder.
- Line 0, Column 0: [Warning: xref-not-found - See documentation]
Cross reference not found: 'System.Reflection.AssemblyLoadContext'.
- Line 0, Column 0: [Warning: disallowed-html-tag - See documentation]
HTML tag 'see' isn't allowed. Replace it with approved Markdown or escape the brackets if the content is a placeholder.
For more details, please refer to the build report.
Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
For any questions, please:
- Try searching the learn.microsoft.com contributor guides
- Post your question in the Learn support channel
Learn Build status updates of commit e78a4cc:
|
File | Status | Preview URL | Details |
---|---|---|---|
xml/System.Reflection/Assembly.xml | View | Details |
xml/System.Reflection/Assembly.xml
- Line 0, Column 0: [Warning: disallowed-html-tag - See documentation]
HTML tag 'see' isn't allowed. Replace it with approved Markdown or escape the brackets if the content is a placeholder.
- Line 0, Column 0: [Warning: disallowed-html-tag - See documentation]
HTML tag 'see' isn't allowed. Replace it with approved Markdown or escape the brackets if the content is a placeholder.
- Line 0, Column 0: [Warning: disallowed-html-tag - See documentation]
HTML tag 'see' isn't allowed. Replace it with approved Markdown or escape the brackets if the content is a placeholder.
- Line 0, Column 0: [Warning: disallowed-html-tag - See documentation]
HTML tag 'see' isn't allowed. Replace it with approved Markdown or escape the brackets if the content is a placeholder.
- Line 0, Column 0: [Warning: disallowed-html-tag - See documentation]
HTML tag 'see' isn't allowed. Replace it with approved Markdown or escape the brackets if the content is a placeholder.
For more details, please refer to the build report.
Note: Your PR may contain errors or warnings or suggestions unrelated to the files you changed. This happens when external dependencies like GitHub alias, Microsoft alias, cross repo links are updated. Please use these instructions to resolve them.
For any questions, please:
- Try searching the learn.microsoft.com contributor guides
- Post your question in the Learn support channel
Summary
The existing docs are only valid for .NET Framework.
Fixes #9765