Windows periodically deletes files in %temp% but keep the folder of the extracted single-file app. And it seems that the files are not re-extracted if the folder already exists (and empty).
This seems to be fixed in .NET 5(?) as I have not been able to reproduce it there.
How to reproduce:
Publish a single-file app (MyApp.exe in this case)
Run it (to produce a temporary folder, e.g. C:\Users\user\AppData\Local\Temp.net\MyApp\vslj0aom.wch)
Delete the contents of vslj0aom.wch, but keep the folder, to mimic the behavior of the periodical Windows clean-up
Try to start MyApp.exe again
RESULT: Application won't start, because files are not re-extracted to %temp%.net\MyApp if vslj0aom.wch exists and empty.
EXPECTED RESULT: Application starts regardless of the state of the temporary directory (with files).
Windows periodically deletes files in %temp% but keep the folder of the extracted single-file app. And it seems that the files are not re-extracted if the folder already exists (and empty).
This seems to be fixed in .NET 5(?) as I have not been able to reproduce it there.
How to reproduce:
RESULT: Application won't start, because files are not re-extracted to %temp%.net\MyApp if vslj0aom.wch exists and empty. EXPECTED RESULT: Application starts regardless of the state of the temporary directory (with files).