We recently faced an issue where a developer used overload of WaitOne() method as follows:
AsyncWaitHandle.WaitOne(timeout)
But this code failed on other machines because there was no overload available with one parameter. After some analysis we figured out that it was because .Net 3.5 SP1 was not installed on other machines. Seems two new overloads were added as part of SP1, namely
public virtual bool WaitOne(System.TimeSpan timeout)
public virtual bool WaitOne(int millisecondsTimeout)
In case you want to avoid this issue and maintain backward compatibility, use AsyncWaitHandle.WaitOne(timeout, false); which is effectively same as AsyncWaitHandle.WaitOne(timeout);
Friday, May 29, 2009
Subscribe to:
Posts (Atom)