Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Another approach than File.Delete(tcFile)
Message
From
30/05/2012 18:00:56
 
 
To
30/05/2012 17:09:34
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01544721
Message ID:
01544865
Views:
29
The documentation on the StandardError property (http://msdn.microsoft.com/en-us/library/system.diagnostics.process.standarderror.aspx) says that ReadToEnd will not complete until the process writes to its error stream or closes it. This can create a deadlock if it writes to its output stream first. See the paragraphs just prior to the examples section. It also details how to use the asynchronous methods like BeginErrorReadLine to avoid the deadlock.

You will probably want to use the WaitForExit method (http://msdn.microsoft.com/en-us/library/ty0d8k56.aspx) to have the process finish before you continue instead of waiting the arbitrary 7 seconds. The WaitForExit call will need to be after reading the StandardError and StandardOutput streams or using their asynchronous equivalents.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform