Nóta
Aðgangur að þessari síðu krefst heimildar. Þú getur prófað aðskrá þig inn eða breyta skráasöfnum.
Aðgangur að þessari síðu krefst heimildar. Þú getur prófað að breyta skráasöfnum.
.NET remoting is a legacy technology, and the infrastructure exists only in .NET Framework. The following remoting-related APIs are marked as obsolete, starting in .NET 5. Using them in code generates warning SYSLIB0010 at compile time and throws a PlatformNotSupportedException at runtime.
Workarounds
Consider using WCF or HTTP-based REST services to communicate with objects in other applications or across machines. For more information, see .NET Framework technologies unavailable on .NET Core.
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 SYSLIB0010
// Code that uses obsolete API.
// ...
// Re-enable the warning.
#pragma warning restore SYSLIB0010
To suppress all the SYSLIB0010 warnings in your project, add a <NoWarn> property to your project file.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
...
<NoWarn>$(NoWarn);SYSLIB0010</NoWarn>
</PropertyGroup>
</Project>
For more information, see Suppress warnings.