In Unity5.6 DiscoverDeviceAsync() works with System.Threading.dll(v1.0.2856.0 added by myself). But same code doesn’t work with unity 2020 (system default “System.Threading.dll” v4.0.11.0). Code like below:
var nat = new NatDiscoverer();
var cts = new CancellationTokenSource(5000);
Task device = nat.DiscoverDeviceAsync(PortMapper.Upnp, cts); //Error occur only this line.
Error CS0012: The type ‘Task<>’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘System.Threading, Version=1.0.2856.102, Culture=neutral, PublicKeyToken=31bf3856ad364e35’.
Same code in Unity5.6 and I copied a System.Threading.dll(v1.0.2856.0), it works very well.
Why and how to sovle this problem? Thanks.