Reputation: 703
Having this code:
Process checkForUpdates = new Process();
checkForUpdates.StartInfo.FileName = @"python";
checkForUpdates.StartInfo.Arguments = "-V";
checkForUpdates.StartInfo.UseShellExecute = true;
checkForUpdates.StartInfo.RedirectStandardOutput = true;
checkForUpdates.StartInfo.RedirectStandardError = true;
checkForUpdates.StartInfo.CreateNoWindow = false;
checkForUpdates.EnableRaisingEvents = true;
checkForUpdates.Start();
string result = checkForUpdates.StandardOutput.ReadToEnd();
I'm trying retrieve the output of the command python -V in order to determine if python is installed on the device.
The code above compiles but the code seems to hang during the process without any errors. The same code works fine on UWP.
Is there any other way to make it work on Android?
Upvotes: 1
Views: 3051
Reputation: 703
The problem was that I run this code inside a background worker. I put the code in a method directly inside ViewModel and it worked perfectly fine.
Upvotes: 1