高分求大神帮忙
using System;
using System.Threading;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Text;
namespace Exercise11
{
class Program
{
static int Test1(int x, string s)
{
Console.WriteLine("Test1");
Thread.Sleep(100);
return 100;
}
static void Main(string[] args)
{
Func<int, string, int> a = Test1;
IAsyncResult ar = a.BeginInvoke(100, "tqt", null, null);//编译器提示这里有错
Console.WriteLine("main");
while (ar.IsCompleted == false)
Console.Write(".");
int result = a.EndInvoke(ar);
Console.WriteLine(result);
}
}
}
在VS2019中编译通过,运行时错误信息是System.PlatformNotSupportedException: Operation is not supported on this platform.
是BeginInvoke这个函数的错误吗?求大神。
...全文


