When reading the 21.9 Other Asynchronous Programming Patterns in the fifth edition of the book "C# Illustrated Tutorial," an error message was encountered when using the BeginInvoke
function according to the example code:
Unhandled exception. System.PlatformNotSupportedException: Operation is not supported on this platform.
After consulting the documentation, starting from .NET Framework 4, the Task Parallel Library provides a new model for asynchronous and parallel programming, namely the Task-based Asynchronous Pattern (TAP). On the latest .NET platform, the BeginInvoke
function and EndInvoke
function are no longer supported. This is noted for reference.
References: