Skip to content

Commit 185af75

Browse files
authored
add syslib0037 (#27855)
1 parent 6525d3c commit 185af75

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

docs/core/compatibility/core-libraries/7.0/obsolete-apis-with-custom-diagnostics.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The following table lists the custom diagnostic IDs and their corresponding warn
1717
| Diagnostic ID | Description | Severity |
1818
| - | - |
1919
| [SYSLIB0036](../../../../fundamentals/syslib-diagnostics/syslib0036.md) | <xref:System.Text.RegularExpressions.Regex.CompileToAssembly%2A?displayProperty=nameWithType> is obsolete and not supported. Use `RegexGeneratorAttribute` with the regular expression source generator instead. | Warning |
20+
| [SYSLIB0037](../../../../fundamentals/syslib-diagnostics/syslib0037.md) | <xref:System.Reflection.AssemblyName> members <xref:System.Reflection.AssemblyName.HashAlgorithm>, <xref:System.Reflection.AssemblyName.ProcessorArchitecture>, and <xref:System.Reflection.AssemblyName.VersionCompatibility> are obsolete and not supported. | Warning |
2021

2122
## Version introduced
2223

@@ -38,6 +39,12 @@ These obsoletions can affect [source compatibility](../../categories.md#source-c
3839

3940
- <xref:System.Text.RegularExpressions.Regex.CompileToAssembly%2A?displayProperty=nameWithType>
4041

42+
### SYSLIB0037
43+
44+
- <xref:System.Reflection.AssemblyName.HashAlgorithm?displayProperty=nameWithType>
45+
- <xref:System.Reflection.AssemblyName.ProcessorArchitecture?displayProperty=nameWithType>
46+
- <xref:System.Reflection.AssemblyName.VersionCompatibility?displayProperty=nameWithType>
47+
4148
## See also
4249

4350
- [API obsoletions with non-default diagnostic IDs (.NET 6)](../6.0/obsolete-apis-with-custom-diagnostics.md)

docs/fundamentals/syslib-diagnostics/obsoletions-overview.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ The following table provides an index to the `SYSLIB0XXX` obsoletions in .NET 5+
5757
| [SYSLIB0034][0034] | Warning | <xref:System.Security.Cryptography.Pkcs.CmsSigner.%23ctor(System.Security.Cryptography.CspParameters)> is obsolete. Use an alternative constructor instead. |
5858
| [SYSLIB0035][0035] | Warning | <xref:System.Security.Cryptography.Pkcs.SignerInfo.ComputeCounterSignature?displayProperty=nameWithType> is obsolete. Use the overload that accepts a <xref:System.Security.Cryptography.Pkcs.CmsSigner> instead. |
5959
| [SYSLIB0036][0036] | Warning | <xref:System.Text.RegularExpressions.Regex.CompileToAssembly%2A?displayProperty=nameWithType> is obsolete and not supported. Use `RegexGeneratorAttribute` with the regular expression source generator instead. |
60+
| [SYSLIB0037][0037] | Warning | <xref:System.Reflection.AssemblyName> members <xref:System.Reflection.AssemblyName.HashAlgorithm>, <xref:System.Reflection.AssemblyName.ProcessorArchitecture>, and <xref:System.Reflection.AssemblyName.VersionCompatibility> are obsolete and not supported. |
6061

6162
<!-- Include adds ## Suppress warnings (H2 heading) -->
6263
[!INCLUDE [suppress-syslib-warning](includes/suppress-syslib-warning.md)]
@@ -97,3 +98,4 @@ The following table provides an index to the `SYSLIB0XXX` obsoletions in .NET 5+
9798
[0034]: syslib0034.md
9899
[0035]: syslib0035.md
99100
[0036]: syslib0036.md
101+
[0037]: syslib0037.md
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
title: SYSLIB0037 warning - AssemblyName members HashAlgorithm, ProcessorArchitecture, and VersionCompatibility are obsolete
3+
description: Learn about the obsoletion of some AssemblyName properties that generates compile-time warning SYSLIB0037.
4+
ms.date: 01/13/2022
5+
---
6+
# SYSLIB0037: AssemblyName members HashAlgorithm, ProcessorArchitecture, and VersionCompatibility are obsolete
7+
8+
The following <xref:System.Reflection.AssemblyName?displayProperty=fullName> properties are marked as obsolete, starting in .NET 7. Using these APIs in code generates warning `SYSLIB0037` at compile time.
9+
10+
- <xref:System.Reflection.AssemblyName.HashAlgorithm>
11+
- <xref:System.Reflection.AssemblyName.ProcessorArchitecture>
12+
- <xref:System.Reflection.AssemblyName.VersionCompatibility>
13+
14+
These properties are not a proper part of an <xref:System.Reflection.AssemblyName> instance. They don't roundtrip through <xref:System.Reflection.AssemblyName> string representation, and they are ignored by the assembly loader in .NET Core.
15+
16+
## Workaround
17+
18+
Don't use these members in scenarios where it was expected for the values to be round-tripped through the string representation of the <xref:System.Reflection.AssemblyName>.
19+
20+
[!INCLUDE [suppress-syslib-warning](includes/suppress-syslib-warning.md)]

docs/fundamentals/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,8 @@ items:
462462
href: syslib-diagnostics/syslib0035.md
463463
- name: SYSLIB0036
464464
href: syslib-diagnostics/syslib0036.md
465+
- name: SYSLIB0037
466+
href: syslib-diagnostics/syslib0037.md
465467
- name: Source-generated code
466468
items:
467469
- name: Overview

0 commit comments

Comments
 (0)