Description
A new empty WPF application targeting .NET 11 crashes on startup when published as a self-contained single-file application.
The failure occurs both with and without IncludeNativeLibrariesForSelfExtract=true. Ordinary non-single-file self-contained publishing works correctly.
This appears related to:
PR #11575 changed DirectWriteForwarder.dll and System.Printing.dll from pure MSIL to IJW mixed-mode assemblies. PR #11664 fixed ordinary self-contained publishing by packaging ijwhost.dll as a native runtime asset, but single-file publishing still bundles DirectWriteForwarder.dll and it fails during startup.
Reproduction Steps
Using .NET SDK 11.0.100-preview.7.26381.103:
dotnet new wpf -n WpfSingleFileRepro -f net11.0
cd WpfSingleFileRepro
dotnet publish -c Release -r win-x64 --self-contained true `
-p:PublishSingleFile=true `
-p:IncludeNativeLibrariesForSelfExtract=true `
-o .\publish-single
.\publish-single\WpfSingleFileRepro.exe
Expected behavior
The empty WPF application should start and display its window.
Actual behavior
The process terminates during System.Windows.Application initialization with exit code 0xE0434352:
Unhandled exception. System.TypeInitializationException:
The type initializer for 'System.Windows.Application' threw an exception.
---> System.TypeInitializationException:
The type initializer for '<Module>' threw an exception.
---> System.BadImageFormatException:
File name: '...\publish-single\DirectWriteForwarder.dll'
at System.Windows.Application.ApplicationInit()
at System.Windows.Application..ctor()
at WpfSingleFileRepro.App.Main()
Regression?
No response
Known Workarounds
No response
Impact
No response
Configuration
SDK: 11.0.100-preview.7.26381.103
Runtime: 11.0.0-preview.7.26381.103
MSBuild: 18.10.0-1.26381.103
OS: Windows 11, build 10.0.26200
Other information
No response
Description
A new empty WPF application targeting .NET 11 crashes on startup when published as a self-contained single-file application.
The failure occurs both with and without
IncludeNativeLibrariesForSelfExtract=true. Ordinary non-single-file self-contained publishing works correctly.This appears related to:
PR #11575 changed
DirectWriteForwarder.dllandSystem.Printing.dllfrom pure MSIL to IJW mixed-mode assemblies. PR #11664 fixed ordinary self-contained publishing by packagingijwhost.dllas a native runtime asset, but single-file publishing still bundlesDirectWriteForwarder.dlland it fails during startup.Reproduction Steps
Using .NET SDK
11.0.100-preview.7.26381.103:Expected behavior
The empty WPF application should start and display its window.
Actual behavior
The process terminates during
System.Windows.Applicationinitialization with exit code0xE0434352:Regression?
No response
Known Workarounds
No response
Impact
No response
Configuration
SDK: 11.0.100-preview.7.26381.103
Runtime: 11.0.0-preview.7.26381.103
MSBuild: 18.10.0-1.26381.103
OS: Windows 11, build 10.0.26200
Other information
No response