Skip to content

Renaming self-contained (?) exe breaks XAML parsing #5457

Open
@styris-ame

Description

@styris-ame

Describe the bug

With WindowsAppSDK 1.8 experimental 1, no issue occurs. However after upgrading to experimental 2, I get the following exception when starting my published single file self-contained unpackaged WinUI 3 app after renaming the published exe file to something else:

[XamlParseException] XAML parsing failed.

int IApplicationOverrides.Do_Abi_OnLaunched_0(thisPtr, args) >
void Application.Microsoft.UI.Xaml.IApplicationOverrides.OnLaunched(args) >
void App.OnLaunched(args) in App.xaml.cs:45 >
new Window() in Window.xaml.cs:46 >
void Window.InitializeComponent() in Window.g.i.cs:69 >
void Application.LoadComponent(component, resourceLocator, componentResourceLocation) >
void IApplicationStaticsMethods.LoadComponent(_obj, component, resourceLocator, componentResourceLocation) >
void ExceptionHelpers.ThrowExceptionForHR(hr)

Pardon the custom stacktrace format

Steps to reproduce the bug

  1. Publish an unpackaged WinUI 3 app with PublishSingleFile, WindowsAppSDKSelfContained, SelfContained, and PublishTrimmed
  2. Rename the resulting binary
  3. Observe error when initializing a Window (may need to reference a resource like an image in the xaml somewhere)

NuGet package version

WinUI 3 - Windows App SDK 1.8 Experimental 1: 1.8.250515001-experimental2

Windows version

Windows 11 (24H2): Build 26100

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-DeveloperToolsIssues related to authoring (source and IDL), debugging, HotReload, LiveVisualTree, VS integrationbugSomething isn't workingneeds-triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions