Skip to content

Rewrite WPF pack-URIs found in CLR strings #387

@warappa

Description

@warappa

Issue

I'm developing a WPF application which uses WPF.UI.

With the newest ILRepack version (2.0.36) the XAML/BAML rewrite works great!
But unfortunately, WPF.UI tends to use hardcoded pack-uris in its code behind files (normal CLR strings). Those are not found/detected by ILRepack.

Eg.
https://github.com/lepoco/wpfui/blob/397739b85cfa616315740a360279f301847fa59d/src/Wpf.Ui/Controls/ContextMenu/ContextMenuLoader.xaml.cs#L45-L51

ResourceDictionary resourceDict =
    new()
    {
        Source = new Uri("pack://application:,,,/Wpf.Ui;component/Controls/ContextMenu/ContextMenu.xaml")
    };

Expectation

Could you try to generally detect "pack:..." strings and rewrite those also (so not only specific to WPF.UI)?

Info

.NET Framework 4.8
ILRepack 2.0.36
WPF.UI 4.0.0-rc.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions