-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Add new syslib warnings #23915
Merged
Merged
Add new syslib warnings #23915
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
bb58e5e
add new syslib warnings
gewarren 28152a0
fix xrefs
gewarren b4ac19d
more fixes
gewarren 198e28f
add to toc
gewarren c5a428e
add see also link
gewarren 7321340
add see also
gewarren 39b1bf6
Merge branch 'main' of github.com:dotnet/docs into syslib
gewarren f3018b1
add more see also links
gewarren File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
title: SYSLIB0013 warning | ||
description: Learn about the EscapeUriString obsoletion that generates compile-time warning SYSLIB0013. | ||
ms.topic: reference | ||
ms.date: 04/24/2021 | ||
--- | ||
# SYSLIB0013: EscapeUriString is obsolete | ||
|
||
The <xref:System.Uri.EscapeUriString(System.String)?displayProperty=nameWithType> API is marked as obsolete, starting in .NET 6. Using it in code generates warning `SYSLIB0013` at compile time. | ||
|
||
<xref:System.Uri.EscapeUriString(System.String)?displayProperty=nameWithType> can corrupt the Uri string in some cases. | ||
|
||
## Workarounds | ||
|
||
Use <xref:System.Uri.EscapeDataString(System.String)?displayProperty=nameWithType> for query string components instead. | ||
|
||
[!INCLUDE [suppress-syslib-warning](../../../../includes/suppress-syslib-warning.md)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
title: SYSLIB0014 warning | ||
description: Learn about the System.Net obsoletions that generate compile-time warning SYSLIB0014. | ||
ms.topic: reference | ||
ms.date: 04/24/2021 | ||
--- | ||
# SYSLIB0014: WebRequest, HttpWebRequest, ServicePoint, WebClient are obsolete | ||
|
||
The following APIs are marked as obsolete, starting in .NET 6. Using them in code generates warning `SYSLIB0014` at compile time. | ||
|
||
- <xref:System.Net.WebRequest?displayProperty=fullName> | ||
- <xref:System.Net.HttpWebRequest?displayProperty=fullName> | ||
- <xref:System.Net.ServicePoint?displayProperty=fullName> | ||
- <xref:System.Net.WebClient?displayProperty=fullName> | ||
|
||
## Workarounds | ||
|
||
Use <xref:System.Net.Http.HttpClient> instead. | ||
|
||
[!INCLUDE [suppress-syslib-warning](../../../../includes/suppress-syslib-warning.md)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
title: SYSLIB0015 warning | ||
description: Learn about the obsoletion of DisablePrivateReflectionAttribute that generates compile-time warning SYSLIB0015. | ||
ms.topic: reference | ||
ms.date: 04/24/2021 | ||
--- | ||
# SYSLIB0015: DisablePrivateReflectionAttribute is obsolete | ||
|
||
The <xref:System.Runtime.CompilerServices.DisablePrivateReflectionAttribute?displayProperty=nameWithType> type is marked as obsolete, starting in .NET 6. Using it in code generates warning `SYSLIB0015` at compile time. | ||
|
||
<xref:System.Runtime.CompilerServices.DisablePrivateReflectionAttribute> has no effect in .NET 6+ applications. | ||
|
||
## Workarounds | ||
|
||
None. | ||
|
||
[!INCLUDE [suppress-syslib-warning](../../../../includes/suppress-syslib-warning.md)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: SYSLIB0016 warning | ||
description: Learn about the GetContextInfo obsoletion that generates compile-time warning SYSLIB0016. | ||
ms.topic: reference | ||
ms.date: 04/24/2021 | ||
--- | ||
# SYSLIB0016: GetContextInfo() is obsolete | ||
|
||
The <xref:System.Drawing.Graphics.GetContextInfo?displayProperty=nameWithType> method that takes no arguments is marked as obsolete, starting in .NET 6. Using it in code generates warning `SYSLIB0016` at compile time. | ||
|
||
## Workarounds | ||
|
||
Use the <xref:System.Drawing.Graphics.GetContextInfo%2A?displayProperty=nameWithType> overloads that accept arguments for better performance and fewer allocations. | ||
|
||
[!INCLUDE [suppress-syslib-warning](../../../../includes/suppress-syslib-warning.md)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
--- | ||
title: SYSLIB0019 warning | ||
description: Learn about the RuntimeEnvironment obsoletions that generate compile-time warning SYSLIB0019. | ||
ms.topic: reference | ||
ms.date: 04/24/2021 | ||
--- | ||
# SYSLIB0019: Some RuntimeEnvironment APIs are obsolete | ||
|
||
The following APIs are marked as obsolete, starting in .NET 6. Using them in code generates warning `SYSLIB0019` at compile time. | ||
|
||
- <xref:System.Runtime.InteropServices.RuntimeEnvironment.SystemConfigurationFile?displayProperty=nameWithType> property | ||
- <xref:System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeInterfaceAsIntPtr(System.Guid,System.Guid)?displayProperty=nameWithType> method | ||
- <xref:System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeInterfaceAsObject(System.Guid,System.Guid)?displayProperty=nameWithType> method | ||
|
||
These APIs throw a <xref:System.PlatformNotSupportedException> at run time. | ||
|
||
## Workarounds | ||
|
||
None. | ||
|
||
[!INCLUDE [suppress-syslib-warning](../../../../includes/suppress-syslib-warning.md)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: SYSLIB0020 warning | ||
description: Learn about the IgnoreNullValues obsoletion that generates compile-time warning SYSLIB0020. | ||
ms.topic: reference | ||
ms.date: 04/24/2021 | ||
--- | ||
# SYSLIB0020: IgnoreNullValues is obsolete | ||
|
||
The <xref:System.Text.Json.JsonSerializerOptions.IgnoreNullValues?displayProperty=nameWithType> property is marked as obsolete, starting in .NET 6. Using it in code generates warning `SYSLIB0020` at compile time. | ||
|
||
## Workarounds | ||
|
||
To ignore null values when serializing, set <xref:System.Text.Json.JsonSerializerOptions.DefaultIgnoreCondition> to <xref:System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull?displayProperty=nameWithType>. | ||
|
||
[!INCLUDE [suppress-syslib-warning](../../../../includes/suppress-syslib-warning.md)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back 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.
https://aka.ms/dotnet-warnings/SYSLIB0013
may need to get updated to this article after it's published. (Same applies to other obsoletion warnings.)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.
@jeffhandley I don't seem to have access to these aka.ms links. Can you update for 13-16, 19-20?
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 will publish these live now.
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 went ahead and created the aka.ms links for SYSLIB0017 through SYSLIB0025. I don't (yet) have access to edit the existing ones, but I submitted a request to gain access.