หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
The following APIS are marked as obsolete, starting in .NET 6. Using them in code generates warning SYSLIB0017 at compile time. These APIs throw a PlatformNotSupportedException at runtime.
For more information, see https://github.com/dotnet/runtime/issues/50529.
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 SYSLIB0017
// Code that uses obsolete API.
// ...
// Re-enable the warning.
#pragma warning restore SYSLIB0017
To suppress all the SYSLIB0017 warnings in your project, add a <NoWarn> property to your project file.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
...
<NoWarn>$(NoWarn);SYSLIB0017</NoWarn>
</PropertyGroup>
</Project>
For more information, see Suppress warnings.