asp.net - Execute async tasks in a web garden -


i have function executes async task run , return results

 public bool checknetworkdrive(string drive)  {     var task = new task<bool>(() => { return checknetworkdrivemethod(drive); });      task.start();      //make async call check network path avoid lock in case of not exist      if (task.wait(5000) && task.result)         return true;      return false;  } 

in local host works fine in webgarden not seems work , can’t figure exact reason, can or suggest alternative !

ps, check method check network path, if it’s not responding block whole code, why need fire , async wait method.

sorry inconvenience, turned out problem not parallel task in particular,i'm using window identity impersonation access network drives , somehow task seems lose impersonation after passed impersonated user task worked fine.

i found helped

how set user identity tasks when calling task.waitall()


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -