I'm pretty sure I have all the right flags and everything set according to Microsoft Docs, however the UI dlls are not being included in the single file exe.
Asked
Active
Viewed 1,396 times
3 Answers
3
AFAIK, you can't. Self-Contained does not mean One-Single-File. It means that all the dependencies will be next to your EXE so you won't need to install runtimes to the target device.

Andrew KeepCoding
- 7,040
- 2
- 14
- 21
-
Thanks, I don't think it's possible either. I ended up just going with self contained non single file. – nathanAjacobs Aug 17 '22 at 14:55
0
Try using https://github.com/Fody/Costura/
It's great for legacy .NET projects. Newer frameworks have single-file executables as shown in their documentation

Bron Davies
- 5,930
- 3
- 30
- 41
-
This isn't a legacy project though. It's .NET 6 with Windows App SDK 1.1 – nathanAjacobs Aug 16 '22 at 14:20
0
Yes - with this (unpackaged / self-contained) command line:
dotnet publish -f net6.0-windows10.0.19041.0 -c Release -p:WindowsPackageType=None -p:SelfContained=true -p:WindowsAppSDKSelfContained=true
Note: This requires Windows App SDK 1.1.0 or above.

Mike Francis
- 71
- 6
-
Hmm, for me this not produces a single file exe. I did the same thing as you on CLI with the apropriate csproj XML settings. I can indeed create EITHER a single file exe (that „resources.something“ file asside), when not going Windows App SDK self-contained (means the SDK has to be installed on the tharget machine or the installer popup shows up), OR a Windows App SDK self-contained application, that is not a single file. Both (a single exe AND deploy SDK with/inside the exe) seems not possible. At least i could not achieve that goal. – MBODM May 25 '23 at 22:03