Skip to content

Commit 86aa22d

Browse files
gewarrenpull[bot]
authored andcommitted
.NET Framework -> .NET (#21105)
1 parent 49c4cdd commit 86aa22d

13 files changed

+195
-189
lines changed

docs/standard/assembly/create-public-private-key-pair.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ms.date: "08/20/2019"
55
helpviewer_keywords:
66
- "key pairs for strong-named assemblies"
77
- "signing assemblies"
8-
- "assemblies [.NET Framework], signing"
8+
- "assemblies [.NET], signing"
99
- "cryptographic key pairs"
1010
- "snk files (key pair files)"
1111
- "public-private key pairs"

docs/standard/assembly/create-use-strong-named.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ helpviewer_keywords:
77
- "strong-named assemblies, about strong-named assemblies"
88
- "strong-named assemblies"
99
- "signing assemblies"
10-
- "assemblies [.NET Framework], signing"
10+
- "assemblies [.NET], signing"
1111
- "strong-named assemblies, scenarios"
12-
- "assemblies [.NET Framework], strong-named"
12+
- "assemblies [.NET], strong-named"
1313
- "strong-named assemblies, loading into trusted application domains"
1414
- "assembly binding, strong-named"
1515
ms.assetid: ffbf6d9e-4a88-4a8a-9645-4ce0ee1ee5f9
@@ -40,7 +40,7 @@ The following scenario outlines the process of signing an assembly with a strong
4040

4141
3. Assembly B is a consumer of Assembly A. The reference section of Assembly B's manifest includes a token that represents Assembly A's public key. A token is a portion of the full public key and is used rather than the key itself to save space.
4242

43-
4. The common language runtime verifies the strong name signature when the assembly is placed in the global assembly cache. When binding by strong name at run time, the common language runtime compares the key stored in Assembly B's manifest with the key used to generate the strong name for Assembly A. If the .NET Framework security checks pass and the bind succeeds, Assembly B has a guarantee that Assembly A's bits have not been tampered with and that these bits actually come from the developers of Assembly A.
43+
4. The common language runtime verifies the strong name signature when the assembly is placed in the global assembly cache. When binding by strong name at run time, the common language runtime compares the key stored in Assembly B's manifest with the key used to generate the strong name for Assembly A. If the .NET security checks pass and the bind succeeds, Assembly B has a guarantee that Assembly A's bits have not been tampered with and that these bits actually come from the developers of Assembly A.
4444

4545
> [!NOTE]
4646
> This scenario doesn't address trust issues. Assemblies can carry full Microsoft Authenticode signatures in addition to a strong name. Authenticode signatures include a certificate that establishes trust. It's important to note that strong names don't require code to be signed in this way. Strong names only provide a unique identity.

docs/standard/assembly/create.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ title: "Create assemblies"
33
description: Learn about creating single-file or multifile assemblies using an IDE, such as Visual Studio, or the compilers and tools provided by the Windows SDK.
44
ms.date: "08/19/2019"
55
helpviewer_keywords:
6-
- "assemblies [.NET Framework], multifile"
6+
- "assemblies [.NET], multifile"
77
- "single-file assemblies"
8-
- "assemblies [.NET Framework], creating"
8+
- "assemblies [.NET], creating"
99
- "multifile assemblies"
1010
ms.assetid: 54832ee9-dca8-4c8b-913c-c0b9d265e9a4
1111
---

docs/standard/assembly/delay-sign.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ms.date: "08/19/2019"
55
helpviewer_keywords:
66
- "deferring assembly signing"
77
- "signing assemblies"
8-
- "assemblies [.NET Framework], signing"
8+
- "assemblies [.NET], signing"
99
- "strong-named assemblies, delaying assembly signing"
1010
- "partial assembly signing"
1111
ms.assetid: 9d300e17-5bf1-4360-97da-2aa55efd9070
@@ -57,7 +57,7 @@ To delay-sign an assembly:
5757
sn –Vr myAssembly.dll
5858
```
5959

60-
To turn off verification on platforms where you cant run the Strong Name tool, such as Advanced RISC Machine (ARM) microprocessors, use the **–Vk** option to create a registry file. Import the registry file into the registry on the computer where you want to turn off verification. The following example creates a registry file for `myAssembly.dll`.
60+
To turn off verification on platforms where you can't run the Strong Name tool, such as Advanced RISC Machine (ARM) microprocessors, use the **–Vk** option to create a registry file. Import the registry file into the registry on the computer where you want to turn off verification. The following example creates a registry file for `myAssembly.dll`.
6161

6262
```console
6363
sn –Vk myRegFile.reg myAssembly.dll

docs/standard/attributes/applying-attributes.md

Lines changed: 33 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,51 @@
22
title: "Applying Attributes"
33
ms.date: "03/30/2017"
44
ms.technology: dotnet-standard
5-
dev_langs:
5+
dev_langs:
66
- "csharp"
77
- "vb"
88
- "cpp"
9-
helpviewer_keywords:
9+
helpviewer_keywords:
1010
- "assemblies [.NET Framework], attributes"
1111
- "attributes [.NET Framework], applying"
1212
ms.assetid: dd7604eb-9fa3-4b60-b2dd-b47739fa3148
1313
---
14-
# Applying Attributes
15-
Use the following process to apply an attribute to an element of your code.
16-
17-
1. Define a new attribute or use an existing attribute by importing its namespace from the .NET Framework.
18-
19-
2. Apply the attribute to the code element by placing it immediately before the element.
20-
14+
# Apply attributes
15+
16+
Use the following process to apply an attribute to an element of your code.
17+
18+
1. Define a new attribute or use an existing .NET attribute.
19+
20+
2. Apply the attribute to the code element by placing it immediately before the element.
21+
2122
Each language has its own attribute syntax. In C++ and C#, the attribute is surrounded by square brackets and separated from the element by white space, which can include a line break. In Visual Basic, the attribute is surrounded by angle brackets and must be on the same logical line; the line continuation character can be used if a line break is desired.
22-
23-
3. Specify positional parameters and named parameters for the attribute.
24-
25-
Positional parameters are required and must come before any named parameters; they correspond to the parameters of one of the attribute's constructors. Named parameters are optional and correspond to read/write properties of the attribute. In C++, and C#, specify `name`=`value` for each optional parameter, where `name` is the name of the property. In Visual Basic, specify `name`:=`value`.
26-
27-
The attribute is emitted into metadata when you compile your code and is available to the common language runtime and any custom tool or application through the runtime reflection services.
28-
29-
By convention, all attribute names end with Attribute. However, several languages that target the runtime, such as Visual Basic and C#, do not require you to specify the full name of an attribute. For example, if you want to initialize <xref:System.ObsoleteAttribute?displayProperty=nameWithType>, you only need to reference it as **Obsolete**.
30-
31-
## Applying an Attribute to a Method
32-
The following code example shows how to declare **System.ObsoleteAttribute**, which marks code as obsolete. The string `"Will be removed in next version"` is passed to the attribute. This attribute causes a compiler warning that displays the passed string when code that the attribute describes is called.
33-
23+
24+
3. Specify positional parameters and named parameters for the attribute.
25+
26+
*Positional* parameters are required and must come before any named parameters; they correspond to the parameters of one of the attribute's constructors. *Named* parameters are optional and correspond to read/write properties of the attribute. In C++, and C#, specify `name=value` for each optional parameter, where `name` is the name of the property. In Visual Basic, specify `name:=value`.
27+
28+
The attribute is emitted into metadata when you compile your code and is available to the common language runtime and any custom tool or application through the runtime reflection services.
29+
30+
By convention, all attribute names end with "Attribute". However, several languages that target the runtime, such as Visual Basic and C#, do not require you to specify the full name of an attribute. For example, if you want to initialize <xref:System.ObsoleteAttribute?displayProperty=nameWithType>, you only need to reference it as **Obsolete**.
31+
32+
## Apply an attribute to a method
33+
34+
The following code example shows how to use **System.ObsoleteAttribute**, which marks code as obsolete. The string `"Will be removed in next version"` is passed to the attribute. This attribute causes a compiler warning that displays the passed string when code that the attribute describes is called.
35+
3436
[!code-cpp[Conceptual.Attributes.Usage#3](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.attributes.usage/cpp/source1.cpp#3)]
3537
[!code-csharp[Conceptual.Attributes.Usage#3](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.attributes.usage/cs/source1.cs#3)]
36-
[!code-vb[Conceptual.Attributes.Usage#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.attributes.usage/vb/source1.vb#3)]
37-
38-
## Applying Attributes at the Assembly Level
39-
If you want to apply an attribute at the assembly level, use the **assembly** (`Assembly` in Visual Basic) keyword. The following code shows the **AssemblyTitleAttribute** applied at the assembly level.
40-
38+
[!code-vb[Conceptual.Attributes.Usage#3](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.attributes.usage/vb/source1.vb#3)]
39+
40+
## Apply attributes at the assembly level
41+
42+
If you want to apply an attribute at the assembly level, use the `assembly` (`Assembly` in Visual Basic) keyword. The following code shows the **AssemblyTitleAttribute** applied at the assembly level.
43+
4144
[!code-cpp[Conceptual.Attributes.Usage#2](../../../samples/snippets/cpp/VS_Snippets_CLR/conceptual.attributes.usage/cpp/source1.cpp#2)]
4245
[!code-csharp[Conceptual.Attributes.Usage#2](../../../samples/snippets/csharp/VS_Snippets_CLR/conceptual.attributes.usage/cs/source1.cs#2)]
43-
[!code-vb[Conceptual.Attributes.Usage#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.attributes.usage/vb/source1.vb#2)]
44-
45-
When this attribute is applied, the string `"My Assembly"` is placed in the assembly manifest in the metadata portion of the file. You can view the attribute either by using the [MSIL Disassembler (Ildasm.exe)](../../framework/tools/ildasm-exe-il-disassembler.md) or by creating a custom program to retrieve the attribute.
46-
46+
[!code-vb[Conceptual.Attributes.Usage#2](../../../samples/snippets/visualbasic/VS_Snippets_CLR/conceptual.attributes.usage/vb/source1.vb#2)]
47+
48+
When this attribute is applied, the string `"My Assembly"` is placed in the assembly manifest in the metadata portion of the file. You can view the attribute either by using the [MSIL Disassembler (Ildasm.exe)](../../framework/tools/ildasm-exe-il-disassembler.md) or by creating a custom program to retrieve the attribute.
49+
4750
## See also
4851

4952
- [Attributes](index.md)

docs/standard/attributes/index.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,35 @@
11
---
22
title: "Extending Metadata Using Attributes"
33
description: Learn how to extend metadata using attributes in .NET. Attributes are keyword-like descriptive declarations to annotate programming elements, like types and fields.
4-
ms.date: "03/30/2017"
4+
ms.date: 10/14/2020
55
ms.technology: dotnet-standard
6-
helpviewer_keywords:
6+
helpviewer_keywords:
77
- "metadata, extending"
8-
- "attributes [.NET Framework], metadata"
9-
- "elements [.NET Framework], attributes"
8+
- "attributes [.NET], metadata"
9+
- "elements [.NET], attributes"
1010
- "common language runtime, attributes"
1111
- "annotating programming elements"
1212
- "keyword-like descriptive declarations"
1313
- "runtime, attributes"
1414
- "extending metadata"
1515
ms.assetid: 30386922-1e00-4602-9ebf-526b271a8b87
1616
---
17-
# Extending Metadata Using Attributes
18-
The common language runtime allows you to add keyword-like descriptive declarations, called attributes, to annotate programming elements such as types, fields, methods, and properties. When you compile your code for the runtime, it is converted into Microsoft intermediate language (MSIL) and placed inside a portable executable (PE) file along with metadata generated by the compiler. Attributes allow you to place extra descriptive information into metadata that can be extracted using runtime reflection services. The compiler creates attributes when you declare instances of special classes that derive from <xref:System.Attribute?displayProperty=nameWithType>.
19-
20-
The .NET Framework uses attributes for a variety of reasons and to address a number of issues. Attributes describe how to serialize data, specify characteristics that are used to enforce security, and limit optimizations by the just-in-time (JIT) compiler so the code remains easy to debug. Attributes can also record the name of a file or the author of code, or control the visibility of controls and members during forms development.
21-
22-
## Related Topics
23-
24-
|Title|Description|
25-
|-----------|-----------------|
26-
|[Applying Attributes](applying-attributes.md)|Describes how to apply an attribute to an element of your code.|
27-
|[Writing Custom Attributes](writing-custom-attributes.md)|Describes how to design custom attribute classes.|
28-
|[Retrieving Information Stored in Attributes](retrieving-information-stored-in-attributes.md)|Describes how to retrieve custom attributes for code that is loaded into the execution context.|
29-
|[Metadata and Self-Describing Components](../metadata-and-self-describing-components.md)|Provides an overview of metadata and describes how it is implemented in a .NET Framework portable executable (PE) file.|
30-
|[How to: Load Assemblies into the Reflection-Only Context](../../framework/reflection-and-codedom/how-to-load-assemblies-into-the-reflection-only-context.md)|Explains how to retrieve custom attribute information in the reflection-only context.|
31-
32-
## Reference
33-
<xref:System.Attribute?displayProperty=nameWithType>
17+
# Extend metadata using attributes
18+
19+
The common language runtime allows you to add keyword-like descriptive declarations, called attributes, to annotate programming elements such as types, fields, methods, and properties. When you compile your code for the runtime, it is converted into Microsoft intermediate language (MSIL) and placed inside a portable executable (PE) file along with metadata generated by the compiler. Attributes allow you to place extra descriptive information into metadata that can be extracted using runtime reflection services. The compiler creates attributes when you declare instances of special classes that derive from <xref:System.Attribute?displayProperty=nameWithType>.
20+
21+
.NET uses attributes for a variety of reasons and to address a number of issues. Attributes describe how to serialize data, specify characteristics that are used to enforce security, and limit optimizations by the just-in-time (JIT) compiler so the code remains easy to debug. Attributes can also record the name of a file or the author of code, or control the visibility of controls and members during forms development.
22+
23+
## Related articles
24+
25+
|Title|Description|
26+
|-----------|-----------------|
27+
|[Applying Attributes](applying-attributes.md)|Describes how to apply an attribute to an element of your code.|
28+
|[Writing Custom Attributes](writing-custom-attributes.md)|Describes how to design custom attribute classes.|
29+
|[Retrieving Information Stored in Attributes](retrieving-information-stored-in-attributes.md)|Describes how to retrieve custom attributes for code that is loaded into the execution context.|
30+
|[Metadata and Self-Describing Components](../metadata-and-self-describing-components.md)|Provides an overview of metadata and describes how it is implemented in a .NET Framework portable executable (PE) file.|
31+
|[How to: Load Assemblies into the Reflection-Only Context](../../framework/reflection-and-codedom/how-to-load-assemblies-into-the-reflection-only-context.md)|Explains how to retrieve custom attribute information in the reflection-only context.|
32+
33+
## Reference
34+
35+
- <xref:System.Attribute?displayProperty=nameWithType>

docs/standard/base-types/best-practices.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dev_langs:
77
- "csharp"
88
- "vb"
99
helpviewer_keywords:
10-
- ".NET Framework regular expressions, best practices"
10+
- ".NET regular expressions, best practices"
1111
- "regular expressions, best practices"
1212
ms.assetid: 618e5afb-3a97-440d-831a-70e4c526a51c
1313
---
@@ -55,7 +55,7 @@ To solve this problem, you can do the following:
5555

5656
## Handle object instantiation appropriately
5757

58-
At the heart of .NETs regular expression object model is the <xref:System.Text.RegularExpressions.Regex?displayProperty=nameWithType> class, which represents the regular expression engine. Often, the single greatest factor that affects regular expression performance is the way in which the <xref:System.Text.RegularExpressions.Regex> engine is used. Defining a regular expression involves tightly coupling the regular expression engine with a regular expression pattern. That coupling process, whether it involves instantiating a <xref:System.Text.RegularExpressions.Regex> object by passing its constructor a regular expression pattern or calling a static method by passing it the regular expression pattern along with the string to be analyzed, is by necessity an expensive one.
58+
At the heart of .NET's regular expression object model is the <xref:System.Text.RegularExpressions.Regex?displayProperty=nameWithType> class, which represents the regular expression engine. Often, the single greatest factor that affects regular expression performance is the way in which the <xref:System.Text.RegularExpressions.Regex> engine is used. Defining a regular expression involves tightly coupling the regular expression engine with a regular expression pattern. That coupling process, whether it involves instantiating a <xref:System.Text.RegularExpressions.Regex> object by passing its constructor a regular expression pattern or calling a static method by passing it the regular expression pattern along with the string to be analyzed, is by necessity an expensive one.
5959

6060
> [!NOTE]
6161
> For a more detailed discussion of the performance implications of using interpreted and compiled regular expressions, see [Optimizing Regular Expression Performance, Part II: Taking Charge of Backtracking](/archive/blogs/bclteam/optimizing-regular-expression-performance-part-ii-taking-charge-of-backtracking-ron-petrusha) in the BCL Team blog.
@@ -130,7 +130,7 @@ The regular expression pattern used in the example, `\b(\w+((\r?\n)|,?\s))*\w+[.
130130

131131
### Regular expressions: Compiled to an assembly
132132

133-
.NET also enables you to create an assembly that contains compiled regular expressions. This moves the performance hit of regular expression compilation from run time to design time. However, it also involves some additional work: You must define the regular expressions in advance and compile them to an assembly. The compiler can then reference this assembly when compiling source code that uses the assemblys regular expressions. Each compiled regular expression in the assembly is represented by a class that derives from <xref:System.Text.RegularExpressions.Regex>.
133+
.NET also enables you to create an assembly that contains compiled regular expressions. This moves the performance hit of regular expression compilation from run time to design time. However, it also involves some additional work: You must define the regular expressions in advance and compile them to an assembly. The compiler can then reference this assembly when compiling source code that uses the assembly's regular expressions. Each compiled regular expression in the assembly is represented by a class that derives from <xref:System.Text.RegularExpressions.Regex>.
134134

135135
To compile regular expressions to an assembly, you call the <xref:System.Text.RegularExpressions.Regex.CompileToAssembly%28System.Text.RegularExpressions.RegexCompilationInfo%5B%5D%2CSystem.Reflection.AssemblyName%29?displayProperty=nameWithType> method and pass it an array of <xref:System.Text.RegularExpressions.RegexCompilationInfo> objects that represent the regular expressions to be compiled, and an <xref:System.Reflection.AssemblyName> object that contains information about the assembly to be created.
136136

0 commit comments

Comments
 (0)