Run process from .NET Core on Mac

660 views Asked by At

I'm trying to run a process from C# console app on Mac:

var processInfo = new ProcessStartInfo("./gradlew", "bundleRelease")
{
    WorkingDirectory = gradlewDir,
    CreateNoWindow = true,
    UseShellExecute = false,
    RedirectStandardError = true,
    RedirectStandardOutput = true
};

var process = Process.Start(processInfo);

It fails with "no such file or directory" error. However if I run:

var files = Directory.GetFiles(gradlewDir); I do see this file in there. I also made sure all permissions are set to run it. I'm able to run it from the terminal too. What am I doing wrong?

0

There are 0 answers