File.Copy as well as File opened as stream and written hangs for network file to local machine
My program needs to copy few log files already generated on a network share. It needs to copy it to a local machine and then do some processing. The problem I'm consistently facing is that the program hangs. Stack trace revealed it's waiting at File.Copy. I guess the process is in kernel mode. And I can't KILL it. I've tried all permutations to kill a process, but it won't die. I've to restart the machine to remove it from this waiting. No matter how much time I give, it never comes back. Initially I was using .NET 4.0's File.Copy()
. After reading few posts at stackoverflow, I tried to read file as stream and write it. But same issue again. I'开发者_Python百科ve no clue why kernel is waiting and for what. I also ran TCPView from sysinternal. I don't see my application having any TCP connection established or in queue.
Do you know what might be wrong? Any debugging tool which can help me here? Any sure short way to copy file over network share which at least fails instead of hanging forever?
精彩评论