Skip to content

Single-file apps are not re-extracted if folder in temp is empty in .NET Core 3 #17190

Open
@jespergustinmsft

Description

@jespergustinmsft

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:

  1. Publish a single-file app (MyApp.exe in this case)
  2. Run it (to produce a temporary folder, e.g. C:\Users\user\AppData\Local\Temp.net\MyApp\vslj0aom.wch)
  3. Delete the contents of vslj0aom.wch, but keep the folder, to mimic the behavior of the periodical Windows clean-up
  4. 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).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions