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

UWP Crashes at Startup when built in Release mode when using some Icon Packs #292

Open
MarkIvanDev opened this issue Apr 4, 2022 · 10 comments

Comments

@MarkIvanDev
Copy link

MarkIvanDev commented Apr 4, 2022

Describe the bug
When building a UWP app in release mode, the application crashes at startup due to a StackOverflow exception. Building using debug mode does not result to a crash for ALL icons. This only happens with the following Icon Packs:

  • Jam Icons
  • Material
  • Material Design
  • Modern
  • PICOL Icons
  • Pixelart Icons
  • Radix Icons
  • Remix Icon
  • RPG Awesome
  • Simple Icons
  • Typicons
  • Unicons
  • Vaadin Icons
  • Zondicons

To Reproduce
Steps to reproduce the behavior:

  1. Extract and open the solution attached in this issue
  2. Uncomment the XAML tags for the Icon Packs marked with 'Bug' in the name and run in RELEASE mode.

Expected behavior
The app should not crash at startup

Desktop Environment (please complete the following information):

  • IconPacks Version: 4.11.0
  • Visual Studio: 2022
  • UWP [10.0.17763 - 10.0.22000]

Repo
MahAppsIcons.zip

Additional context
This seems to be related to #138

@punker76
Copy link
Member

@MarkIvanDev Idk exactly why this happens. I can see that the XamlTypeInfo for Debug is different to Release but Idk why...

@punker76
Copy link
Member

@MarkIvanDev If I disable "Compile with .NET Native tool chain" the app runs fine. That's the reason why I'm hate UWP!

image

@MarkIvanDev
Copy link
Author

MarkIvanDev commented Sep 28, 2022

Yes. It only runs when not compiling with .NET Native toolchain. I have also checked what is different with the icons with bugs from the ones that work correctly, and nothing stands out that might cause the problem. Although, I have read somewhere that there is a limit to the length of a string in a library. Maybe it is having problems with the massive icon data for those icon packs?

@punker76
Copy link
Member

@MarkIvanDev

Although, I have read somewhere that there is a limit to the length of a string in a library. Maybe it is having problems with the massive icon data for those icon packs?

But it's working on WPF. You can see it in action with the IconPacks browser.

@MarkIvanDev
Copy link
Author

@punker76

But it's working on WPF. You can see it in action with the IconPacks browser.

Yes. Maybe the string limitation is only enforced in .NET Native? Or .NET Native has a problem with a large number of static strings? I have tried creating a new package for UWP with the problematic icon packs using the same path data, but it still triggers the error stated above. But when I put the data inside a sqlite database and read from that, the error does not show and it compiles and runs successfully when using .NET Native.

@timunie
Copy link
Contributor

timunie commented Sep 29, 2022

Interesting finding. Do you think source generators may be helpful in that case?

@MarkIvanDev
Copy link
Author

Interesting finding. Do you think source generators may be helpful in that case?

If the source generators will only generate the same classes with the same static strings as data, I don't think it will make a difference. But I think if the path data will be put in resource files (.resx), I think we can work around the static string length limitation

@timunie
Copy link
Contributor

timunie commented Oct 3, 2022

No, the idea was to generate the PathGeometry directly.

@punker76
Copy link
Member

punker76 commented Oct 3, 2022

@timunie Generating the path data directly is not possible, because of the different source of the icons. That’s why I didn’t publish my converter.

@MarkIvanDev I will try and look if the resx can help here.

@MarkIvanDev
Copy link
Author

@MarkIvanDev I will try and look if the resx can help here.

If there is anything I can help with, I'd love to.

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

No branches or pull requests

3 participants