Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 1.81 KB

syslib0009.md

File metadata and controls

51 lines (36 loc) · 1.81 KB
title description ms.date f1_keywords
SYSLIB0009 warning
Learn about the obsoletions that generate compile-time warning SYSLIB0009.
10/20/2020
syslib0009

SYSLIB0009: AuthenticationManager is not supported

The following APIs are marked obsolete, starting in .NET 5. Use of these APIs generates warning SYSLIB0009 at compile time and throws a xref:System.PlatformNotSupportedException at run time.

  • xref:System.Net.AuthenticationManager.Authenticate%2A?displayProperty=nameWithType
  • xref:System.Net.AuthenticationManager.PreAuthenticate%2A?displayProperty=nameWithType

In .NET 9 and later versions, the entire xref:System.Net.AuthenticationManager class is marked obsolete. Use of this class generates warning SYSLIB0009 at compile time. The methods in this class either no-op or throw a xref:System.PlatformNotSupportedException at run time.

Workarounds

Implement xref:System.Net.IAuthenticationModule, which has methods that were previously called by xref:System.Net.AuthenticationManager.Authenticate%2A?displayProperty=nameWithType.

Suppress a warning

If you must use the obsolete APIs, you can suppress the warning in code or in your project file.

To suppress only a single violation, add preprocessor directives to your source file to disable and then re-enable the warning.

// Disable the warning.
#pragma warning disable SYSLIB0009

// Code that uses obsolete API.
// ...

// Re-enable the warning.
#pragma warning restore SYSLIB0009

To suppress all the SYSLIB0009 warnings in your project, add a <NoWarn> property to your project file.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
   ...
   <NoWarn>$(NoWarn);SYSLIB0009</NoWarn>
  </PropertyGroup>
</Project>

For more information, see Suppress warnings.