Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PublishSingleFile exe dependant on Temp Directory #3885

Closed
JBrandon369 opened this issue Nov 21, 2019 · 6 comments
Closed

PublishSingleFile exe dependant on Temp Directory #3885

JBrandon369 opened this issue Nov 21, 2019 · 6 comments

Comments

@JBrandon369
Copy link

JBrandon369 commented Nov 21, 2019

Issue Title

PublishSingleFile exe dependant on Temp Directory

General

OS: Windows 10 Enterprise - 10.0.18363
.Net Core Version: 3.0.100

I recently had an exe created with the PublishSingleFile stop working on me. it appears that when it was published some dlls were created in the /appdata/local/temp/.net directory and the exe requires those to run properly for some reason. This is an issue as these files can disappear at anytime and permanently break the exe. i would also imagine this makes the exe impossible to port to another machine.

Command Run:
dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true

Exact Project Used:
EchoServer.zip

you can reproduce this issue easily by publishing using the above command, and than going to /appdata/local/temp/.net and deleting the files their.

@nrandell
Copy link

Just to add to this - I've had a customer running a single exe for about 2 months. All of a sudden it has stopped working and saying The application to execute does not exists with an AppData\Local\Temp\.net path

Looks like an identical problem

@SusLes
Copy link
Contributor

SusLes commented Dec 5, 2019

@livarcocc

@livarcocc
Copy link

@jeffschwMSFT owns the single file exe feature. Any ideas?

@jeffschwMSFT
Copy link
Member

@swaroop-sridhar

@swaroop-sridhar
Copy link

@JBrandon369, @nrandell

In .net Core 3, single-file apps are supported by extracting the contents to a temporary directory: %TEMP%.net<appName><id>*. The application host tries to reuse the extracted contents if the above directory exists. If the extracted directory doesn't exist, the host re-extracts the contents, but it doesn't guard against partial cleanup of the directory. In this case, the files within %TEMP%.net<appName><id>\ were deleted by Windows, but the containing directory itself wasn't deleted yet. So, in this intermediate state, the .net host tries to reuse the extraction, but fails.

You can circumvent the problem by setting DOTNET_BUNDLE_EXTRACT_BASE_DIR to a non-temporary location where the OS doesn't cleanup the files.

@swaroop-sridhar
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants