The question How to get temporary folder for current user nicely describes how to go about finding the temp folder to be used for the current user.
In the documentation of Path.GetTempPath
it notes only one exception which can arise due to security permissions.
There is no mention of failure modes if no temp folder can be located.
Is the no-temp-folder case realistic? Or would a missing temp folder indicate something like Windows being more generally trashed?
I guess this question boils down to: does an application that needs the temp folder attempt need to detect / recover / gracefully handle if there isn't one? Or is that so outside what should ever reasonably occur on a working Windows PC that you can just blindly rely on it?
(Personally I have never run into a PC without a working temp location, but we have occasional reports from end users where this seems to be the case. I could imagine some noise in that information, however).