question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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:

  1. Clone https://github.com/SteamDatabase/ValveResourceFormat
  2. 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:closed
  • Created 3 years ago
  • Comments:16 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
xPawcommented, Dec 22, 2020

Setting the IncludeAllContentForSelfExtract property to true in your project should work around this issue. Can you try this please?

Appears to have helped, although it is slower because it has to extract into temp (afaik).

1reaction
xPawcommented, Dec 23, 2020

you can get the manifest to work and not use IncludeAllContentForSelfExtract?

Correct. https://github.com/SteamDatabase/ValveResourceFormat/commit/a7d07725cc23b9b47bd2302cfcbdc2411dc5a0a0

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found