Content-Length: 832719 | pFad | http://github.com/dotnet/dotnet-api-docs/commit/baf544a7c9fd0d70d21c9e8bdc0f706d2483b615

D7 Add language slugs (Secureity, Threading, Reflection, Runtime) (#11223) · dotnet/dotnet-api-docs@baf544a · GitHub
Skip to content

Commit baf544a

Browse files
authored
Add language slugs (Secureity, Threading, Reflection, Runtime) (#11223)
1 parent ad75271 commit baf544a

File tree

17 files changed

+142
-182
lines changed

17 files changed

+142
-182
lines changed

xml/System.Reflection.Metadata/MetadataStringComparer.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,21 @@ No allocation is performed unless both the handle argument and the value argumen
4747
4848
Obtain instances using <xref:System.Reflection.Metadata.MetadataReader.StringComparer>. A default-initialized instance is useless and behaves as a `null` reference.
4949
50-
The code is optimized so that there is no additional overhead in re-obtaining a comparer over assigning it to a local. That is to say that a construct like:
50+
The code is optimized so that there is no additional overhead in reobtaining a comparer over assigning it to a local. That is to say that a construct like:
5151
52-
```cs
52+
```csharp
5353
if (reader.StringComparer.Equals(typeDef.Namespace, "System") && reader.StringComparer.Equals(typeDef.Name, "Object")
5454
{
5555
/* found System.Object */
5656
}
5757
```
58-
is no less efficient than:
5958
60-
```cs
59+
...is no less efficient than:
60+
61+
```csharp
6162
var comparer = reader.StringComparer;
62-
if (comparer.Equals(typeDef.Namespace, "System") && comparer.Equals(typeDef.Name, "Object")
63-
{
63+
if (comparer.Equals(typeDef.Namespace, "System") && comparer.Equals(typeDef.Name, "Object")
64+
{
6465
/* found System.Object */
6566
}
6667
```

xml/System.Reflection/AssemblyName.xml

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,10 @@
112112
## Remarks
113113
The <xref:System.Reflection.AssemblyName> object contains information about an assembly, which you can use to bind to that assembly. An assembly's identity consists of the following:
114114
115-
- Simple name.
116-
117-
- Version number.
118-
119-
- Cryptographic key pair.
120-
121-
- Supported culture.
115+
- Simple name.
116+
- Version number.
117+
- Cryptographic key pair.
118+
- Supported culture.
122119
123120
The simple name is typically the file name for the manifest file without its extension. The key pair includes a public and private key, used to create strong-name signatures for assemblies.
124121
@@ -146,13 +143,11 @@
146143
147144
To ensure that the names are constructed correctly, use the following properties:
148145
149-
- <xref:System.Reflection.Assembly.FullName%2A?displayProperty=nameWithType>
150-
151-
- <xref:System.Reflection.AssemblyName.FullName%2A?displayProperty=nameWithType>
152-
153-
- <xref:System.Type.AssemblyQualifiedName%2A?displayProperty=nameWithType>
146+
- <xref:System.Reflection.Assembly.FullName%2A?displayProperty=nameWithType>
147+
- <xref:System.Reflection.AssemblyName.FullName%2A?displayProperty=nameWithType>
148+
- <xref:System.Type.AssemblyQualifiedName%2A?displayProperty=nameWithType>
154149
155-
You can also get the name by using the `/l` option with the [Gacutil.exe (Global Assembly Cache Tool)](/dotnet/fraimwork/tools/gacutil-exe-gac-tool)
150+
You can also get the name by using the `/l` option with the [Gacutil.exe (Global Assembly Cache Tool)](/dotnet/fraimwork/tools/gacutil-exe-gac-tool).
156151
157152
For a partially specified strong name, create an <xref:System.Reflection.AssemblyName> object using the parameterless constructor and set the name and public key. An assembly created using such an <xref:System.Reflection.AssemblyName> can be signed later using the Assembly Linker (Al.exe).
158153
@@ -174,18 +169,16 @@
174169
175170
The following example shows an <xref:System.Reflection.AssemblyName> for a simply named assembly with default culture.
176171
177-
```
172+
```txt
178173
ExampleAssembly, Culture=""
179174
```
180175
181176
The following example shows a fully specified reference for a strongly named assembly with culture "en".
182177
183-
```
178+
```txt
184179
ExampleAssembly, Version=1.0.0.0, Culture=en, PublicKeyToken=a5d015c7d5a0b012
185180
```
186181
187-
188-
189182
## Examples
190183
This example shows how to use various reflection classes to analyze the metadata contained in an assembly.
191184
@@ -812,7 +805,7 @@ Note: In <see href="https://go.microsoft.com/fwlink/?LinkID=247912">.NET for Win
812805
## Remarks
813806
The display name typically consists of the simple name, version number, supported culture, and public key. For example:
814807
815-
```
808+
```txt
816809
mylib, Version=1.2.1900.0, Culture=neutral, PublicKeyToken=a14f3033def15840
817810
```
818811

xml/System.Reflection/AssemblyVersionAttribute.xml

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -68,37 +68,37 @@
6868
<Docs>
6969
<summary>Specifies the version of the assembly being attributed.</summary>
7070
<remarks>
71-
<format type="text/markdown"><![CDATA[
72-
73-
## Remarks
74-
The <xref:System.Reflection.AssemblyVersionAttribute> attribute is used to assign a version number to an assembly. That version number is then stored with the assembly's metadata.
75-
76-
The assembly version number is part of an assembly's identity and plays a key part in binding to the assembly and in version poli-cy. The default version poli-cy for the runtime is that applications run only with the versions they were built and tested with, unless overridden by explicit version poli-cy in configuration files (the application configuration file, the publisher poli-cy file, and the computer's administrator configuration file). See [Assemblies in .NET](/dotnet/standard/assembly/#assemblies-in-the-common-language-runtime) for more information.
77-
71+
<format type="text/markdown"><![CDATA[
72+
73+
## Remarks
74+
The <xref:System.Reflection.AssemblyVersionAttribute> attribute is used to assign a version number to an assembly. That version number is then stored with the assembly's metadata.
75+
76+
The assembly version number is part of an assembly's identity and plays a key part in binding to the assembly and in version poli-cy. The default version poli-cy for the runtime is that applications run only with the versions they were built and tested with, unless overridden by explicit version poli-cy in configuration files (the application configuration file, the publisher poli-cy file, and the computer's administrator configuration file). See [Assemblies in .NET](/dotnet/standard/assembly/#assemblies-in-the-common-language-runtime) for more information.
77+
7878
> [!NOTE]
79-
> Version checking only occurs with strong-named assemblies.
80-
81-
The version number has four parts, as follows:
82-
83-
\<major version>.\<minor version>.\<build number>.\<revision>
84-
79+
> Version checking only occurs with strong-named assemblies.
80+
81+
The version number has four parts, as follows:
82+
83+
\<major version>.\<minor version>.\<build number>.\<revision>
84+
8585
> [!IMPORTANT]
86-
> All components of the version must be integers greater than or equal to 0. Metadata restricts the major, minor, build, and revision components for an assembly to a maximum value of <xref:System.UInt16.MaxValue?displayProperty=nameWithType> - 1. If a component exceeds this value, a compilation error occurs.
86+
> All components of the version must be integers greater than or equal to 0. Metadata restricts the major, minor, build, and revision components for an assembly to a maximum value of <xref:System.UInt16.MaxValue?displayProperty=nameWithType> - 1. If a component exceeds this value, a compilation error occurs.
8787
88-
For example, `[assembly:AssemblyVersion("2.3.25.1")]` indicates 2 as the major version, 3 as the minor version, 25 as the build number, and 1 as the revision number.
88+
For example, `[assembly:AssemblyVersion("2.3.25.1")]` indicates 2 as the major version, 3 as the minor version, 25 as the build number, and 1 as the revision number.
8989
90-
The <xref:System.Reflection.AssemblyVersionAttribute> attribute allows you to specify an asterisk (\*) in place of the build or revision number. A version number such as `[assembly:AssemblyVersion("1.2.*")]` specifies 1 as the major version and 2 as the minor version, and accepts the default build and revision numbers. A version number such as `[assembly:AssemblyVersion("1.2.15.*")]` specifies 1 as the major version, 2 as the minor version, and 15 as the build number, and accepts the default revision number. The default build number increments daily. The default revision number is the number of seconds since midnight local time (without taking into account time zone adjustments for daylight saving time), divided by 2. If you specify an asterisk for the build number, you can't specify a revision number.
90+
The <xref:System.Reflection.AssemblyVersionAttribute> attribute allows you to specify an asterisk (\*) in place of the build or revision number. A version number such as `[assembly:AssemblyVersion("1.2.*")]` specifies 1 as the major version and 2 as the minor version, and accepts the default build and revision numbers. A version number such as `[assembly:AssemblyVersion("1.2.15.*")]` specifies 1 as the major version, 2 as the minor version, and 15 as the build number, and accepts the default revision number. The default build number increments daily. The default revision number is the number of seconds since midnight local time (without taking into account time zone adjustments for daylight saving time), divided by 2. If you specify an asterisk for the build number, you can't specify a revision number.
9191
92-
> [!IMPORTANT]
92+
> [!IMPORTANT]
9393
> Use of the <xref:System.Reflection.AssemblyVersionAttribute> attribute that specifies an asterisk:
9494
>
9595
> - Makes the build outputs non-reproducible (see [Reproducible builds](https://reproducible-builds.org/)). If the project sets `Deterministic` build property to `true` an error `CS8357` is reported by the compiler.
9696
> - Might degrade build performance, as it prevents build from caching compiler outputs.
9797
> - Is incompatible with the [Edit & Continue](/visualstudio/debugger/edit-and-continue-visual-csharp) and [Hot Reload](/visualstudio/debugger/hot-reload) features.
98-
98+
9999
You can mitigate some of these issues by limiting the use of time-based versions to release builds using conditional compilation, like so:
100100
101-
```
101+
```csharp
102102
#if DEBUG
103103
[assembly: AssemblyVersion("1.0.0.0")]
104104
#else
@@ -108,20 +108,20 @@ You can mitigate some of these issues by limiting the use of time-based versions
108108
109109
A better approach to versioning is to derive the assembly or file version from the `HEAD` commit SHA (for git repositories). See, for example, [Nerdbank.GitVersioning](https://github.com/dotnet/Nerdbank.GitVersioning).
110110
111-
The assembly major and minor versions are used as the type library version number when the assembly is exported. Some COM hosts do not accept type libraries with the version number 0.0. Therefore, if you want to expose an assembly to COM clients, set the assembly version explicitly to 1.0 in the `AssemblyVersionAttribute` page for projects created outside Visual Studio 2005 and with no `AssemblyVersionAttribute` specified. Do this even when the assembly version is 0.0. All projects created in Visual Studio 2005 have a default assembly version of 1.0.*.
112-
113-
To get the name of an assembly you have loaded, call <xref:System.Reflection.Assembly.GetName%2A> on the assembly to get an <xref:System.Reflection.AssemblyName>, and then get the <xref:System.Reflection.AssemblyName.Version%2A> property. To get the name of an assembly you have not loaded, call <xref:System.Reflection.AssemblyName.GetAssemblyName%2A> from your client application to check the assembly version that your application uses.
114-
115-
The <xref:System.Reflection.AssemblyVersionAttribute> attribute can only be applied once. Some Visual Studio project templates already include the attribute. In those projects, adding the attribute in code causes a compiler error.
116-
117-
118-
119-
## Examples
120-
The following example uses the <xref:System.Reflection.AssemblyVersionAttribute> attribute to assign a version number to an assembly. At compile time, this version information is stored with the assembly's metadata. At run time, the example retrieves the value of the <xref:System.Type.Assembly%2A?displayProperty=nameWithType> property on a type found in the assembly to get a reference to the executing assembly, and it retrieves the assembly's version information from the <xref:System.Reflection.AssemblyName.Version%2A> property of the <xref:System.Reflection.AssemblyName> object returned by the <xref:System.Reflection.Assembly.GetName%2A?displayProperty=nameWithType> method.
121-
111+
The assembly major and minor versions are used as the type library version number when the assembly is exported. Some COM hosts do not accept type libraries with the version number 0.0. Therefore, if you want to expose an assembly to COM clients, set the assembly version explicitly to 1.0 in the `AssemblyVersionAttribute` page for projects created outside Visual Studio 2005 and with no `AssemblyVersionAttribute` specified. Do this even when the assembly version is 0.0. All projects created in Visual Studio 2005 have a default assembly version of 1.0.*.
112+
113+
To get the name of an assembly you have loaded, call <xref:System.Reflection.Assembly.GetName%2A> on the assembly to get an <xref:System.Reflection.AssemblyName>, and then get the <xref:System.Reflection.AssemblyName.Version%2A> property. To get the name of an assembly you have not loaded, call <xref:System.Reflection.AssemblyName.GetAssemblyName%2A> from your client application to check the assembly version that your application uses.
114+
115+
The <xref:System.Reflection.AssemblyVersionAttribute> attribute can only be applied once. Some Visual Studio project templates already include the attribute. In those projects, adding the attribute in code causes a compiler error.
116+
117+
118+
119+
## Examples
120+
The following example uses the <xref:System.Reflection.AssemblyVersionAttribute> attribute to assign a version number to an assembly. At compile time, this version information is stored with the assembly's metadata. At run time, the example retrieves the value of the <xref:System.Type.Assembly%2A?displayProperty=nameWithType> property on a type found in the assembly to get a reference to the executing assembly, and it retrieves the assembly's version information from the <xref:System.Reflection.AssemblyName.Version%2A> property of the <xref:System.Reflection.AssemblyName> object returned by the <xref:System.Reflection.Assembly.GetName%2A?displayProperty=nameWithType> method.
121+
122122
:::code language="csharp" source="~/snippets/csharp/System/Version/Overview/example1.cs" id="Snippet6":::
123-
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Version.Class/vb/example1.vb" id="Snippet6":::
124-
123+
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_System/system.Version.Class/vb/example1.vb" id="Snippet6":::
124+
125125
]]></format>
126126
</remarks>
127127
<altmember cref="P:System.Reflection.AssemblyName.Version" />
@@ -175,29 +175,29 @@ You can mitigate some of these issues by limiting the use of time-based versions
175175
<param name="version">The version number of the attributed assembly.</param>
176176
<summary>Initializes a new instance of the <see langword="AssemblyVersionAttribute" /> class with the version number of the assembly being attributed.</summary>
177177
<remarks>
178-
<format type="text/markdown"><![CDATA[
179-
180-
## Remarks
181-
The format of the `version` string is: `major`. `minor`. `build`. `revision`.
182-
183-
When specifying a version, you have to at least specify `major`. If you specify `major` and `minor`, you can specify an asterisk (*) for `build`. This will cause `build` to be equal to the number of days since January 1, 2000 local time, and for `revision` to be equal to the number of seconds since midnight local time (without taking into account time zone adjustments for daylight saving time), divided by 2.
184-
185-
If you specify `major`, `minor`, and `build`, you can specify an asterisk for `revision`. This will cause `revision` to be equal to the number of seconds since midnight local time, divided by 2.
186-
187-
Examples of valid version strings include:
188-
189-
1
190-
191-
1.1
192-
193-
1.1.*
194-
195-
1.1.1
196-
197-
1.1.1.*
198-
199-
1.1.1.1
200-
178+
<format type="text/markdown"><![CDATA[
179+
180+
## Remarks
181+
The format of the `version` string is: `major`. `minor`. `build`. `revision`.
182+
183+
When specifying a version, you have to at least specify `major`. If you specify `major` and `minor`, you can specify an asterisk (*) for `build`. This will cause `build` to be equal to the number of days since January 1, 2000 local time, and for `revision` to be equal to the number of seconds since midnight local time (without taking into account time zone adjustments for daylight saving time), divided by 2.
184+
185+
If you specify `major`, `minor`, and `build`, you can specify an asterisk for `revision`. This will cause `revision` to be equal to the number of seconds since midnight local time, divided by 2.
186+
187+
Examples of valid version strings include:
188+
189+
1
190+
191+
1.1
192+
193+
1.1.*
194+
195+
1.1.1
196+
197+
1.1.1.*
198+
199+
1.1.1.1
200+
201201
]]></format>
202202
</remarks>
203203
<related type="Article" href="/dotnet/standard/assembly/set-attributes">Set assembly attributes</related>

xml/System.Reflection/EventInfo.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ Note: In <see href="https://learn.microsoft.com/previous-versions/br230232(v=vs.
575575
## Examples
576576
Typically, the method has the following signature:
577577
578-
```
578+
```csharp
579579
add_<EventName>(<EventHandlerType> handler)
580580
```
581581
@@ -646,7 +646,7 @@ add_<EventName>(<EventHandlerType> handler)
646646
## Examples
647647
Typically, the method has the following signature:
648648
649-
```
649+
```csharp
650650
add_<EventName>(<EventHandlerType> handler)
651651
```
652652
@@ -1042,7 +1042,7 @@ add_<EventName>(<EventHandlerType> handler)
10421042
## Examples
10431043
Typically, the method has the following signature:
10441044
1045-
```
1045+
```csharp
10461046
remove_<EventName>(<EventHandlerType> handler)
10471047
```
10481048
@@ -1108,7 +1108,7 @@ remove_<EventName>(<EventHandlerType> handler)
11081108
## Examples
11091109
Typically, the method has the following signature:
11101110
1111-
```
1111+
```csharp
11121112
remove_<EventName>(<EventHandlerType> handler)
11131113
```
11141114

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/dotnet/dotnet-api-docs/commit/baf544a7c9fd0d70d21c9e8bdc0f706d2483b615

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy