Relative Content

Tag Archive for c#apiweb

The task is not canceled after a specified period of time

I have a С# web api application that accepts requests (from a website, for example) to solve mathematical problems. Since solving such problems can take a very long time, i use a separate console application for them, which is launched from the Web api, and transfer data via the clipboard. In addition, i set the timeout (via CancellationToken) and, if the console application does not have time to complete its work, i forcibly terminate it using the Kill function.
Here is the code: