My program uses this method to invoke a new process:
public List<string> NewChangesets(string location)
{
var changeInfoProcess = new Process
{
StartInfo = new ProcessStartInfo
{
WorkingDirectory = location,
WindowStyle = ProcessWindowStyle.Hidden,
CreateNoWindow = true,
FileName = "hg",
Arguments = "incoming",
UseShellExecute = false,
RedirectStandardOutput = true
}
};
changeInfoProcess.Start();
It works fine when it is called normally, but when it is invoked from a timer it will sit on the .Start()
method and not advance any further. I have tried setting the priority of the current thread to the highest, but no luck.
This is how I set up my timer:
System.Threading.Timer is the timer I am using
TimerCallback partTimerDelegate = new TimerCallback(Build);
Timer partTimerItem = new Timer(partTimerDelegate, (object)false, 0, (int)new TimeSpan(1, 0, 0).TotalMilliseconds);
Any reason why this doesn't work in a Timer callback?