Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Another approach than File.Delete(tcFile)
Message
De
30/05/2012 18:00:56
 
 
À
30/05/2012 17:09:34
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01544721
Message ID:
01544865
Vues:
30
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform