C#C
C#2y ago
brownie

✅ WPF application doesn't boot when packed to single file

Hello, I made a program in WPF, and in the publish settings I enabled "Produce single file", but the output .exe crashes before the window even shows up. There is an error in the event viewer, but I'm not exactly sure what to make of it (https://pastebin.com/85J3ZzDL). Here are my publish settings:
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
  <PropertyGroup>
    <Configuration>Release</Configuration>
    <Platform>Any CPU</Platform>
    <PublishDir>D:\Mistakes\VideoCompressor</PublishDir>
    <PublishProtocol>FileSystem</PublishProtocol>
    <_TargetId>Folder</_TargetId>
    <TargetFramework>net8.0-windows</TargetFramework>
    <RuntimeIdentifier>win-x86</RuntimeIdentifier>
    <SelfContained>true</SelfContained>
    <PublishSingleFile>true</PublishSingleFile>
    <PublishReadyToRun>false</PublishReadyToRun>
  </PropertyGroup>
</Project>
Was this page helpful?