Single File publish doesn't work with a WPF app

0

I have a simple WPF app that I want to publish as a single exe file. I invoke the command:

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

In the end, I get the exe and pdb files. When I try to run the exe, the cursor turns into "loading" state for a few seconds and... that's it. The app doesn't run. There's no error, it just doesn't start. When I deploy the app without the "single file" option, the app works fine.

I'm using .NET Core 3.1.401

What is wrong?

//EDIT

Dependency Walker logs (I published app in x86 and used x86 Dependency Walker):

Started "ADP.WPFUI.EXE" (process 0x40FC) at address 0x00860000 by thread 1.  Cannot hook module.
Loaded "NTDLL.DLL" at address 0x77C20000 by thread 1.  Cannot hook module.
Loaded "KERNEL32.DLL" at address 0x759C0000 by thread 1.  Cannot hook module.
Loaded "KERNELBASE.DLL" at address 0x75BC0000 by thread 1.  Cannot hook module.
DllMain(0x75BC0000, DLL_PROCESS_ATTACH, 0x00000000) in "KERNELBASE.DLL" called by thread 1.
DllMain(0x75BC0000, DLL_PROCESS_ATTACH, 0x00000000) in "KERNELBASE.DLL" returned 1 (0x1) by thread 1.
DllMain(0x759C0000, DLL_PROCESS_ATTACH, 0x00000000) in "KERNEL32.DLL" called by thread 1.
DllMain(0x759C0000, DLL_PROCESS_ATTACH, 0x00000000) in "KERNEL32.DLL" returned 1 (0x1) by thread 1.
Injected "DEPENDS.DLL" at address 0x08370000 by thread 1.
DllMain(0x08370000, DLL_PROCESS_ATTACH, 0x00000000) in "DEPENDS.DLL" called by thread 1.
DllMain(0x08370000, DLL_PROCESS_ATTACH, 0x00000000) in "DEPENDS.DLL" returned 1 (0x1) by thread 1.
Second chance exception 0xC0000005 (Access Violation) occurred at address 0x707AE0E0 by thread 1.
Exited "ADP.WPFUI.EXE" (process 0x40FC) with code -1073741819 (0xC0000005) by thread 1.

c#
.net
wpf
.net-core
.net-core-publishsinglefile
asked on Stack Overflow Aug 28, 2020 by Loreno • edited Aug 28, 2020 by Loreno

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0