I have this function that executes an async task run and return results
public bool CheckNetworkDrive(string drive)
{
var task = new Task<bool>(() => { return CheckNetworkDriveMethod(drive); });
task.Start();
//make async call to check network path to avoid lock in case of not exist
if (task.Wait(5000) && task.Result)
return true;
return false;
}
in local host everything works fine but in webgarden its not seems to work and I can’t figure the exact reason, so can you help or suggest an alternative !
ps, the check method will check network path, if it’s not responding it will block the whole code, so that why I need fire and async wait method.