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

dotnet 5 single file extracts files into a temporary folder #16763

Open
uffebjorklund opened this issue Apr 6, 2021 · 1 comment
Open

dotnet 5 single file extracts files into a temporary folder #16763

uffebjorklund opened this issue Apr 6, 2021 · 1 comment

Comments

@uffebjorklund
Copy link

Description

On windows we distribute our application as a single file executable. We have been doing this since dotnet core 3.1 and we had a lot of issues when doing this since the file actually was extracted to a temp folder which caused all kinds of trouble.

In dotnet core 5 the documentation says

Bundling all application-dependent files into a single binary provides an application developer with the attractive option to deploy and distribute the application as a single file. This deployment model has been available since .NET Core 3.0 and has been enhanced in .NET 5.0. Previously in .NET Core 3.0, when a user runs your single-file app, .NET Core host first extracts all files to a temporary directory before running the application. .NET 5.0 improves this experience by directly running the code without the need to extract the files from the app.

This is not true... I am running our application on a win2019 server (clean install), and when I run the application I get temporary folder under C:\Windows\Temp\.net\<MyApplication>\<random-folder-name>.

This is actually even worse than the behavior in 3.1 since we in 3.1 could use DOTNET_BUNDLE_EXTRACT_BASE_DIR to target a custom dir. In dotnet 5 using DOTNET_BUNDLE_EXTRACT_BASE_DIR will use another folder but always add an extra folder with a custom name (in my latest test dvay3ibe.r5m ).

Publish

This is how our application is published

dotnet publish ../src/WindowsService/ -c release -r win-x64 /p:PublishSingleFile=true -o ./

dotnet --info

.NET SDK (reflecting any global.json):
 Version:   5.0.102
 Commit:    71365b4d42

Runtime Environment:
 OS Name:     ubuntu
 OS Version:  20.10
 OS Platform: Linux
 RID:         ubuntu.20.10-x64
 Base Path:   /usr/share/dotnet/sdk/5.0.102/

Host (useful for support):
  Version: 5.0.2
  Commit:  cb5f173b96

.NET SDKs installed:
  3.1.404 [/usr/share/dotnet/sdk]
  5.0.101 [/usr/share/dotnet/sdk]
  5.0.102 [/usr/share/dotnet/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 3.1.10 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 5.0.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 3.1.10 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 5.0.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET runtimes or SDKs:
  https://aka.ms/dotnet-download
@Jozkee Jozkee transferred this issue from dotnet/core Apr 6, 2021
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Apr 6, 2021
@wli3 wli3 removed their assignment Apr 7, 2021
@wli3 wli3 added Area-ILLink and removed untriaged Request triage from a team member labels Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants