Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion docs/project/list-of-diagnostics.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The PR that reveals the implementation of the `<IncludeInternalObsoleteAttribute
| __`SYSLIB0006`__ | Thread.Abort is not supported and throws PlatformNotSupportedException. |
| __`SYSLIB0007`__ | The default implementation of this cryptography algorithm is not supported. |
| __`SYSLIB0008`__ | The CreatePdbGenerator API is not supported and throws PlatformNotSupportedException. |
| __`SYSLIB0009`__ | The AuthenticationManager Authenticate and PreAuthenticate methods are not supported and throw PlatformNotSupportedException. |
| __`SYSLIB0009`__ | AuthenticationManager is not supported. Methods will no-op or throw PlatformNotSupportedException. |
| __`SYSLIB0010`__ | This Remoting API is not supported and throws PlatformNotSupportedException. |
| __`SYSLIB0011`__ | `BinaryFormatter` serialization is obsolete and should not be used. See https://aka.ms/binaryformatter for recommended alternatives. |
| __`SYSLIB0012`__ | Assembly.CodeBase and Assembly.EscapedCodeBase are only included for .NET Framework compatibility. Use Assembly.Location instead. |
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/Common/src/System/Obsoletions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ internal static class Obsoletions
internal const string CreatePdbGeneratorMessage = "The CreatePdbGenerator API is not supported and throws PlatformNotSupportedException.";
internal const string CreatePdbGeneratorDiagId = "SYSLIB0008";

internal const string AuthenticationManagerMessage = "The AuthenticationManager Authenticate and PreAuthenticate methods are not supported and throw PlatformNotSupportedException.";
internal const string AuthenticationManagerMessage = "AuthenticationManager is not supported. Methods will no-op or throw PlatformNotSupportedException.";
Comment thread
deeprobin marked this conversation as resolved.
internal const string AuthenticationManagerDiagId = "SYSLIB0009";

internal const string RemotingApisMessage = "This Remoting API is not supported and throws PlatformNotSupportedException.";
Expand Down
3 changes: 1 addition & 2 deletions src/libraries/System.Net.Requests/ref/System.Net.Requests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@

namespace System.Net
{
[System.ObsoleteAttribute("AuthenticationManager is not supported. Methods will no-op or throw PlatformNotSupportedException.", DiagnosticId="SYSLIB0009", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
Comment thread
MihaZupan marked this conversation as resolved.
public partial class AuthenticationManager
{
internal AuthenticationManager() { }
public static System.Net.ICredentialPolicy? CredentialPolicy { get { throw null; } set { } }
public static System.Collections.Specialized.StringDictionary CustomTargetNameDictionary { get { throw null; } }
public static System.Collections.IEnumerator RegisteredModules { get { throw null; } }
[System.ObsoleteAttribute("The AuthenticationManager Authenticate and PreAuthenticate methods are not supported and throw PlatformNotSupportedException.", DiagnosticId = "SYSLIB0009", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static System.Net.Authorization? Authenticate(string challenge, System.Net.WebRequest request, System.Net.ICredentials credentials) { throw null; }
[System.ObsoleteAttribute("The AuthenticationManager Authenticate and PreAuthenticate methods are not supported and throw PlatformNotSupportedException.", DiagnosticId = "SYSLIB0009", UrlFormat = "https://aka.ms/dotnet-warnings/{0}")]
public static System.Net.Authorization? PreAuthenticate(System.Net.WebRequest request, System.Net.ICredentials credentials) { throw null; }
public static void Register(System.Net.IAuthenticationModule authenticationModule) { }
public static void Unregister(System.Net.IAuthenticationModule authenticationModule) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

namespace System.Net
{
[Obsolete(Obsoletions.AuthenticationManagerMessage, DiagnosticId = Obsoletions.AuthenticationManagerDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
public class AuthenticationManager
{
private AuthenticationManager() { }
Expand All @@ -14,11 +15,9 @@ private AuthenticationManager() { }

public static StringDictionary CustomTargetNameDictionary { get; } = new StringDictionary();

[Obsolete(Obsoletions.AuthenticationManagerMessage, DiagnosticId = Obsoletions.AuthenticationManagerDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
public static Authorization? Authenticate(string challenge, WebRequest request, ICredentials credentials) =>
throw new PlatformNotSupportedException();

[Obsolete(Obsoletions.AuthenticationManagerMessage, DiagnosticId = Obsoletions.AuthenticationManagerDiagId, UrlFormat = Obsoletions.SharedUrlFormat)]
public static Authorization? PreAuthenticate(WebRequest request, ICredentials credentials) =>
throw new PlatformNotSupportedException();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Xunit;

#pragma warning disable CS0618 // obsolete warnings
#pragma warning disable SYSLIB0009 // The class is obsolete

namespace System.Net.Tests
{
Expand All @@ -14,10 +15,8 @@ public class AuthenticationManagerTest
[Fact]
public void Authenticate_NotSupported()
{
#pragma warning disable SYSLIB0009 // The methods are obsolete
Assert.Throws<PlatformNotSupportedException>(() => AuthenticationManager.Authenticate(null, null, null));
Assert.Throws<PlatformNotSupportedException>(() => AuthenticationManager.PreAuthenticate(null, null));
#pragma warning restore SYSLIB0009
}

[Fact]
Expand Down