Skip to content

Latest commit

 

History

History
44 lines (32 loc) · 1.31 KB

syslib0025.md

File metadata and controls

44 lines (32 loc) · 1.31 KB
title description ms.date f1_keywords
SYSLIB0025 warning
Learn about the obsoletion of SuppressIldasmAttribute that generates compile-time warning SYSLIB0025.
06/21/2021
syslib0025

SYSLIB0025: SuppressIldasmAttribute is obsolete

The xref:System.Runtime.CompilerServices.SuppressIldasmAttribute type is marked as obsolete, starting in .NET 6. Using it in code generates warning SYSLIB0025 at compile time. IL Disassembler (ildasm.exe) no longer supports this attribute.

Workarounds

None.

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 SYSLIB0025

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

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

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

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

For more information, see Suppress warnings.