ОК, я знаю, что вы заявили, что хотели бы избежать использования cmd, но, поскольку вы в основном пытаетесь выполнить 64-битный процесс из 32-битного, вам всегда придётся делать обходной путь, который делает что-то подобное, поскольку он не может разместить его в процессе.
Я создал быстрый пример решения (Visual Studio 2017) здесь:
https://github.com/Moobylicious/RunExternalProcessExample/archive/master.zip
Содержит два консольных проекта - один 64-битный и один 32-битный. 32-битный вызывает 64-битный, создавая процесс (командная строка в действительности, но скрытая). затем он отображает вывод этого.
Если вы просто запустите решение «как есть», оно должно запустить 32-разрядное консольное приложение, которое вызовет 64-разрядное.
Ниже приведен основной код для запуска внешнего процесса. Версия в примере - это метод Main () консольного приложения, но вам, вероятно, придется поместить его в библиотеку классов или что-то еще, что требуется для плагина / Activity / thingy для ваших конкретных нужд.
public int RunProgram()
{
//create process to run an external program...
System.Diagnostics.Process process = new System.Diagnostics.Process();
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo();
//hide it - don't spawn a CMD window
startInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
startInfo.FileName = "cmd.exe";
//add command line params - guess these would be passed in somehow?
var arg1 = "function_name";
var arg2 = "input1";
var arg3 = "input2";
//Build command line.
startInfo.Arguments = $@"/C c:\path\to\python\Some64BitProcess.exe {arg1} {arg2} {arg3}";
//I don't know what the output of this will be. whether it creates a file or
//just prints stuff out on the command line (STDOUT).
//it is possible to capture STDOUT into a stream, but for simplicity I'll simply re-direct it into
//an output file via the command line '>' which will overwrite any file already there.
startInfo.Arguments += " > output.txt";
process.StartInfo = startInfo;
//Run process
process.Start();
//wait for it to complete - note, if this process pauses for user input at
//any point this will basically just hang indefinitely.
//you CAN pipe a 'Y' into it or something to avoid this(simulate a keypress),
//but would be better to work out command line
//switches that supress any waiting for user input.
process.WaitForExit();
//now, we can get results.
var output = File.ReadAllText("output.txt");
//Do things with output?
Console.WriteLine(output);
Console.ReadLine();
//process.ExitCode is the Exit Code of the command. This might be useful as it might
//indicate specific errors encountered
//by Python.
return process.ExitCode;
}