Nóta
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as shíniú isteach nó eolairí a athrú.
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as eolairí a athrú.
The following Regex and RegexRunner APIs are obsolete, starting in .NET 8. Calling them in code generates warning SYSLIB0052 at compile time. These APIs supported the now obsolete CompileToAssembly.
- Regex.InitializeReferences()
- Regex.UseOptionC()
- Regex.UseOptionR()
- RegexRunner.CharInSet(Char, String, String)
- RegexRunner.Scan(Regex, String, Int32, Int32, Int32, Int32, Boolean)
- RegexRunner.Scan(Regex, String, Int32, Int32, Int32, Int32, Boolean, TimeSpan)
Workaround
N/A
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 SYSLIB0052
// Code that uses obsolete API.
// ...
// Re-enable the warning.
#pragma warning restore SYSLIB0052
To suppress all the SYSLIB0052 warnings in your project, add a <NoWarn> property to your project file.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
...
<NoWarn>$(NoWarn);SYSLIB0052</NoWarn>
</PropertyGroup>
</Project>
For more information, see Suppress warnings.