Nice for making sure stuff is cleaned up for methods that can throw but that give ownership to the caller on success rather than disposing:
var tempFile = new TempFile();
using var successTracker = new ConditionalDisposer(tempFile);
// Do stuff with the temporary file that involves reading from sources that may throw
successTracker.CancelDisposal();
return tempFile;