Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 3 additions & 11 deletions xml/System/Activator.xml
Original file line number Diff line number Diff line change
Expand Up @@ -278,17 +278,9 @@
`assemblyName` can be either of the following:

- The simple name of an assembly, without its path or file extension. For example, you would specify `TypeExtensions` for an assembly whose path and name are .\bin\TypeExtensions.dll.

- The full name of a signed assembly, which consists of its simple name, version, culture, and public key token; for example, "TypeExtensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=181869f2f7435b51".

For more information on how the common language runtime identifies and loads assemblies, see [How the Runtime Locates Assemblies](/dotnet/framework/deployment/how-the-runtime-locates-assemblies). For information on using the application configuration file to define assembly locations, see [Specifying an Assembly's Location](/dotnet/framework/configure-apps/specify-assembly-location). If `assemblyName` is found, it is loaded in the default context.

In .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of <xref:System.Runtime.Loader.AssemblyLoadContext.CurrentContextualReflectionContext*?displayProperty=nameWithType>.

> [!NOTE]
> This method can be used to create nonpublic types if the caller has been granted <xref:System.Security.Permissions.ReflectionPermission> with the <xref:System.Security.Permissions.ReflectionPermissionFlag.RestrictedMemberAccess?displayProperty=nameWithType> flag and if the grant set of the assembly that contains the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later.


Assembly loads triggered by this API are affected by the current value of <xref:System.Runtime.Loader.AssemblyLoadContext.CurrentContextualReflectionContext*?displayProperty=nameWithType>.

## Examples
The following example defines a class named `Person` in an assembly named `PersonInfo`. Note that the `Person` class has two constructors, one of which is parameterless.
Expand Down Expand Up @@ -631,7 +623,7 @@
## Remarks
Use <xref:System.Runtime.Remoting.ObjectHandle.Unwrap*?displayProperty=nameWithType> to unwrap the return value.

In .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of <xref:System.Runtime.Loader.AssemblyLoadContext.CurrentContextualReflectionContext*?displayProperty=nameWithType>.
Assembly loads triggered by this API are affected by the current value of <xref:System.Runtime.Loader.AssemblyLoadContext.CurrentContextualReflectionContext*?displayProperty=nameWithType>.

> [!NOTE]
> This method can be used to create nonpublic types if the caller has been granted <xref:System.Security.Permissions.ReflectionPermission> with the <xref:System.Security.Permissions.ReflectionPermissionFlag.RestrictedMemberAccess?displayProperty=nameWithType> flag and if the grant set of the nonpublic types is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later.
Expand Down Expand Up @@ -1089,7 +1081,7 @@ An error occurred when attempting remote activation in a target specified in <pa
## Remarks
Use <xref:System.Runtime.Remoting.ObjectHandle.Unwrap*?displayProperty=nameWithType> to unwrap the return value.

In .NET Core 3.0 and later versions, assembly loads triggered by this API are affected by the current value of <xref:System.Runtime.Loader.AssemblyLoadContext.CurrentContextualReflectionContext*?displayProperty=nameWithType>.
Assembly loads triggered by this API are affected by the current value of <xref:System.Runtime.Loader.AssemblyLoadContext.CurrentContextualReflectionContext*?displayProperty=nameWithType>.

> [!NOTE]
> This method can be used to create nonpublic types and members if the caller has been granted <xref:System.Security.Permissions.ReflectionPermission> with the <xref:System.Security.Permissions.ReflectionPermissionFlag.RestrictedMemberAccess?displayProperty=nameWithType> flag and if the grant set of the assembly that contains the nonpublic types and members is restricted to the caller's grant set or to a subset thereof. (See [Security Considerations for Reflection](/dotnet/framework/reflection-and-codedom/security-considerations-for-reflection).) To use this functionality, your application should target .NET Framework 3.5 or later.
Expand Down
26 changes: 2 additions & 24 deletions xml/System/AppContext.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@
<Docs>
<summary>Provides members for setting and retrieving data about an application's context.</summary>
<remarks>For more information about this API, see <see href="/dotnet/fundamentals/runtime-libraries/system-appcontext">Supplemental API remarks for AppContext</see>.</remarks>
<related type="Article" href="/dotnet/framework/configure-apps/file-schema/runtime/runtime-element">&lt;runtime&gt; Element</related>
<related type="Article" href="/dotnet/framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element">&lt;AppContextSwitchOverrides&gt; Element</related>
</Docs>
<Members>
<Member MemberName="BaseDirectory">
Expand Down Expand Up @@ -114,11 +112,7 @@
<remarks>
<format type="text/markdown"><![CDATA[

## Remarks

This is a per-application domain property. Its value corresponds to the <xref:System.AppDomain.BaseDirectory?displayProperty=nameWithType> property of the current application domain.

In .NET 5 and later versions, for bundled assemblies, the value returned is the containing directory of the host executable.
For bundled assemblies, the value returned is the containing directory of the host executable.

]]></format>
</remarks>
Expand Down Expand Up @@ -285,22 +279,6 @@ In .NET 5 and later versions, for bundled assemblies, the value returned is the
> - *Switch*.*namespace*.*switchname*
> - *Switch*.*library*.*switchname*

For applications running on .NET Framework, in addition to setting the value of a switch programmatically, it can also be set:

- By adding the switch name and value to the [\<AppContextSwitchOverrides>](/dotnet/framework/configure-apps/file-schema/runtime/appcontextswitchoverrides-element) element in the [\<runtime>](/dotnet/framework/configure-apps/file-schema/runtime/runtime-element) section of an application configuration file. For example, the following defines a switch named `Libraries.FPLibrary.UseExactFloatingPointComparison` whose value is `False`.

```xml
<configuration>
<runtime>
<AppContextSwitchOverrides value="Libraries.FPLibrary.UseExactFloatingPointComparison=false" />
</runtime>
</configuration>
```

- By adding a string value whose name is the name of the switch to the **HKLM\SOFTWARE\Microsoft\\.NETFramework\AppContext** (and **HKLM\SOFTWARE\Wow6432Node\Microsoft\\.NETFramework\AppContext**) subkeys in the registry. Its value must be the string representation of a <xref:System.Boolean> that can be parsed by the <xref:System.Boolean.Parse*?displayProperty=nameWithType> method; that is, it must be "True", "true", "False", or "false".

If the registry entry exists, its value is overwritten by the `isEnabled` argument when <xref:System.AppContext.SetSwitch*> is called. That is, the most recent call to the <xref:System.AppContext.SetSwitch*> method overrides the value defined in the registry, in an app configuration file, or by previous calls to the <xref:System.AppContext.SetSwitch*> method.

## Examples
The following line of code sets a switch named `Switch.AmazingLib.ThrowOnException` to `true`, which enables a legacy behavior. The library can then check whether a library consumer has set the value of the switch by calling the <xref:System.AppContext.TryGetSwitch*> method.

Expand Down Expand Up @@ -369,7 +347,7 @@ In .NET 5 and later versions, for bundled assemblies, the value returned is the
<format type="text/markdown"><![CDATA[

## Remarks
The name of the target framework version corresponds to the value of the <xref:System.Runtime.Versioning.TargetFrameworkAttribute.FrameworkName?displayProperty=nameWithType> property. For a list of target framework names for .NET Framework, see the [&lt;supportedRuntime&gt; Element](/dotnet/framework/configure-apps/file-schema/startup/supportedruntime-element) element.
The name of the target framework version corresponds to the value of the <xref:System.Runtime.Versioning.TargetFrameworkAttribute.FrameworkName?displayProperty=nameWithType> property.

]]></format>
</remarks>
Expand Down
Loading
Loading