So basically I tried following some Tutorials und examples on how to cancel an Task. I understand, that you need a CancellationTokenSource token out of which you can extract a token that you need as an parameter (CancellationToken token) for the Task you want to stop My problem is: when i press the "cancel"Button nothing… Read More I tried to work with Cancellationtoken but it wont work
Given the following code you would expect that the DoWait method is executed for one second in both cases. However, it works for the first case but hangs for the second. If we add async/await to the local method the behavior is as expected. Given that that CTs are structs and hence passed around by… Read More Why are CancellationTokens not working if local methods are used?