dotnet / dotnet/dotnet-api-docs
Example for Process.EnableRaisingEvents Property (and for ExitTime) is incorrect, InvalidOperationException is thrown on access to StartTime
- Lingua principale
- C#
- Stelle
- 949
- Fork
- 1.7k
- Merge medio
- 2g 19h
- PR unite (30g)
- 52
Descrizione
---
**Issue moved from MicrosoftDocs/feedback#3325**
- Please respond to @apegushin.
---
_From @apegushin on Friday, December 11, 2020 11:22:15 PM_
Example for Process.EnableRaisingEvents (and ExitTime) Property shows how to handle 'Exited' event. In the handler process.StartTime is accessed, which throws InvalidOperationException for processes that are not running (which is 100% true for the process that Exited). Examples need to be revised and access to StartTime should be removed. I'm seeing this on WSL2/Ubuntu, but StartTime property documentation suggests that this behavior is consistent across OSes.
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con gli esempi delle proprietà Process.EnableRaisingEvents e ExitTime, concentrandoti sul gestore dell'evento Exited descritto nell'issue. Rimuovi l'accesso a process.StartTime dagli esempi, quindi verifica che gli esempi revisionati non tentino più di leggerlo dopo l'uscita del processo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- csharp
- Ambito
- documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 35/100