[5.0.101] Published single file binary crashes on startup with 0x80070002 in EnableVisualStyles()
See original GitHub issue- .NET Core Version:
5.0.101
- Have you experienced this same bug with .NET Framework?:
No
Problem description:
Publishing a single file binary produces a binary that just crashes on startup when launched from explorer. Launching cmd and then starting the exe from there, actually runs.
Not publishing for single file also works correctly.
This worked on 5.0.0 release.
System.IO.FileNotFoundException
The system cannot find the file specified. (0x80070002)
Expected behavior: App works
Minimal repro:
- Clone https://github.com/SteamDatabase/ValveResourceFormat
cd GUI && dotnet publish
We have builds on appveyor as well (GUI.zip) that are broken: https://ci.appveyor.com/project/xPaw/valveresourceformat/builds/36727211/artifacts
I created this issue in winforms because I suspect https://github.com/dotnet/winforms/pull/4177 could be the culprit. If not, could this be moved to runtime repo please.
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (10 by maintainers)
Top Results From Across the Web
.Net 5 Self-contained single file deployment of default ...
Using .net 5.0.2 a project created using the Winforms desktop c# template and published as a self-contained single file crashes on start-up in...
Read more >A published single-file app crashes on startup under ...
A published single-file app crashes on startup under Windows 7 (.NET 5.0, self-contained). CS CS.
Read more >Crashing on startup and launch • Discussions
Ever since a couple months ago DisplayFusion crashes on startup and after launch. It starts for a couple seconds and then immediately crashes....
Read more >Visual Studio 2022 crashing on startup - Microsoft Q&A
It re-created the folder and the 2 contained files. Now everything works fine. Cause: I compared the new files with the original files:...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Appears to have helped, although it is slower because it has to extract into temp (afaik).
Correct. https://github.com/SteamDatabase/ValveResourceFormat/commit/a7d07725cc23b9b47bd2302cfcbdc2411dc5a0a0