Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception while running simple WPF application published with PublishTrimmed=true #2950

Closed
MartinStrbak opened this issue Jun 27, 2019 · 1 comment

Comments

@MartinStrbak
Copy link

Steps to reproduce:

  1. Create new WPF application (via CLI - dotnet new wpf).
  2. Add Textblock element to MainWindow.xaml, so it contains
    <Grid> <TextBlock>Hello, world</TextBlock> </Grid>
  3. Publish application with PublishTrimmed set to true (dotnet publish -c Release -r win-x64 -o C:\example /p:PublishTrimmed=true)

Application does not start and exception is logged in Event Log:

Application: example.exe
CoreCLR Version: 4.700.19.30373
.NET Core Version: 3.0.0-preview6-27804-01
Description: The process was terminated due to an unhandled exception.
Exception Info: System.TypeInitializationException: The type initializer for 'System.Windows.Media.FontFamily' threw an exception. ---> System.TypeInitializationException: The type initializer for 'MS.Internal.FontCache.DWriteFactory' threw an exception. ---> System.InvalidCastException: Specified cast is not valid.

(full exception list in attached file.)
error.txt

@MartinStrbak
Copy link
Author

Seems to be duplicate of dotnet/linker#595.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant