JobObjectWrapper: Unable to instantiate JobObject

I want to use JobObjectWrapper in my application to limit the process memory. I am trying to install JobObject with the following code:

        JobObject job = new JobObject("Hello");

        ProcessStartInfo ps = new ProcessStartInfo("notepad.exe");
        job.CreateProcessSecured(ps);

but I get the following exception:

Unhandled exception: JobManagement.JobException: runni ng control process inside Job, it will not be able to assign child processes to a new job.

I get this exception when I try to run examples in a solution from codeplex (fe EndOfProcessMemory).

What am I doing wrong? Thanks in advance:)

+3
source share

Source: https://habr.com/ru/post/1789217/


All Articles