Returns the ID of the currently executing Task.
Assemblies: System.Threading.Tasks (in System.Threading.Tasks.dll)
mscorlib (in mscorlib.dll)
is a static (Shared in Visual Basic) property that is used to get the identifier of the currently executing task from the code that the task is executing. It differs from the Id property, which returns the identifier of a particular Task instance. If you attempt to retrieve the value from outside the code that a task is executing, the property returns a null reference (Nothing in Visual Basic).
Note that although collisions are very rare, task identifiers are not guaranteed to be unique.