Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/fsharp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# CancellationTokenRegistration.Unregister()的netstandard2.1版本_C#_.net - Fatal编程技术网

C# CancellationTokenRegistration.Unregister()的netstandard2.1版本

C# CancellationTokenRegistration.Unregister()的netstandard2.1版本,c#,.net,C#,.net,netcoreapp3.0和netcoreapp3.1提供了一个函数CancellationTokenRegistration.Unregister(),但它在netstandard2.1中不可用。为什么会这样?有没有办法在netstandard2.1中注销 文档只是说它在2.1中不可用 这里的讨论让我相信它在2.1中是不可用的 有什么解决办法吗?类似的事情我可以做吗?我知道这篇文章很旧,但我想澄清一下发生了什么 CancellationTokenRegistration.Unregister

netcoreapp3.0
netcoreapp3.1
提供了一个函数
CancellationTokenRegistration.Unregister()
,但它在
netstandard2.1
中不可用。为什么会这样?有没有办法在
netstandard2.1
中注销

文档只是说它在2.1中不可用

这里的讨论让我相信它在2.1中是不可用的


有什么解决办法吗?类似的事情我可以做吗?

我知道这篇文章很旧,但我想澄清一下发生了什么

CancellationTokenRegistration.Unregister()
已被删除,以便对相应的
Registration
实例调用
Dispose


如果您想了解这一切是如何运作的,请查看。

对此有何结论?@bruno.almeida no,对不起。坦白地说,我不记得我做了什么来解决这个问题,我想我制作了一个私有的存储库分支,并将它从netstandard升级到netcoreapp。。。这可能是不对的,但你知道有时候是怎么回事。@bruno.almeida——它被移除了。要取消注册,可以通过调用
dispose
方法来处理
CancellationTokenRegistration
。如有疑问,请查看。@Andy谢谢,请随时发布答案,我将accept@xandermonkey--听起来不错。补充了一个答案