Skip to content

IndexOutOfRangeException in Release-Distribution #585

Closed

Description

@stephanblaurock

I'm trying to render a simple MD-String I get following error:

var output = Markdown.ToHtml("# This is a test");

System.TypeInitializationException: The type initializer for 'Markig.Markdown' threw an exception. ---> System.IndexOutOfRangeException: Index was outside the bounds of the array. at Markdig.Markdown..cctor()..

In the simulator, everything works fine in both DEBUG build and RELEASE build
On the physical device (via InHouse-Distribution) everything works in the DEBUG build but NOT in the RELEASE build :-(

My environment:
MacOSX Big Sur (11.6.1)
Visual Studio for Mac (8.10.16 build 2)
Xamarin Forms (5.0.0.2291)
Markdig (0.26.0)
iOS-Simulator (15.2)
iOS-Device (15.2)

Activity

  1. MihaZupan commented on Jan 19, 2022

    @MihaZupan
    Collaborator

    This is most likely the same as #536 and #564.

    The problem is not with Markdig, but with Xamarin iOS (e.g. a linker being too aggressive in removing attributes).

    My suggestion is the same as for the other issues #564 (comment) - file an issue with Xamarin so they can investigate.
    Or if you are interested in doing the investigation yourself, a good start would be

    Something you could try is to build Markdig yourself and remove this line to see if the problem still reproduces. If it requires an actual device, I'm afraid I can't validate the change myself.

  2. ptrkbmn commented on Mar 9, 2022

    @ptrkbmn

    Should be fixed with #600

  3. MihaZupan commented on Mar 30, 2022

    @MihaZupan
    Collaborator

    Closing as fixed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions