0

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?

oo_dev
  • 777
  • 7
  • 20
Ryan Erb
  • 828
  • 1
  • 8
  • 28
  • What do you mean by "not advanced any further?" are you running the program in debug mode? – yakiro Oct 01 '13 at 19:45
  • Yes when I pause the program in debug mode it is stopped at that line. I have given it a about 20 minutes to see if it will advance any further but it will not. – Ryan Erb Oct 01 '13 at 19:50

0 Answers0