ookii-dialogs / ookii-dialogs-wpf

Awesome dialogs for Windows Desktop applications built with Microsoft .NET (WPF)
BSD 3-Clause "New" or "Revised" License
1.14k stars 85 forks source link

Embed XPThemes.manifest in the assembly to resolve EntryPointNotFoundException #31

Closed augustoproiete closed 3 years ago

augustoproiete commented 3 years ago

.NET Core 3.1 and .NET 5 apps using Ookii.Dialogs currently need to add an app.manifest file with a reference to Microsoft.Windows.Common-Controls to the application. Without the manifest the user gets an EntryPointNotFoundException.

image

This was not a requirement for .NET Framework apps because Microsoft included the XPThemes.manifest together with the .NET Framework, but stopped including it with .NET Core and didn't include it with .NET 5 either.

Let's add the XPThemes.manifest file as an embedded resource to Ookii Dialogs assembly and load it from the resources moving forward, thus removing the dependency on the file being part of the .NET installation, which is the same approach that Windows Forms is using when running as single-file.


This invalidates #30 as we won't have the EntryPointNotFoundException anymore.