[Feature Request] Alternate Variation W/O System.Memory Reference and compat w/AOT/UNITY #435

Closed
opened 2026-01-29 14:36:36 +00:00 by claunia · 1 comment
Owner

Originally created by @codiemorgan on GitHub (Feb 12, 2021).

As per the title, I am wondering if we may get NetStandard2.0 builds of MarkDig which do not reference System.Memory, or a build conditional which could be implemented to allow building from source to allow for builds which exclude optimizations which may rely on System.Memory and System.Buffers?

This is primarily for compatibility within Unity and it's supported platform targets.
To get around this, I currently use CommonMark, and intend to use it to to allow markdown formatting of In-game ui elements/quests, etc and to enable support for Markdown Files/Strings within unity's inspectors by translating HTML output into USS/UXML layouts.

System.Memory is an obstacle if we wish to build for WebGL and Mobile Platforms within Unity using NetStandard2.0, but is possible (with additional setup) to use when targeting .NET4.X on standalone (Desktop) platforms.

There are some other limitations which may affect Markdig compatibility with unity's NetStandard2 implementation (below).

My hope is for a variant of Markdig which will function out of the box in when taking the following into account

  • Targeting .NetStandard2/NET461 within Unity (manual create and edit csc.rsp, not guaranteed for all platforms)

  • Net4.X: Minimum target is 4.6.1, maximum is a limited subset up to 4.7.

  • NetStandard: Only 2.0 is supported currently.

  • IL2CPP / AOT Platforms (with code stripping) - when using NetStandard2 while targeting WebGL

  • IL2CPP / AOT Platforms when targeting IOS/Android from within Unity (threading is possible).

  • Android: System.IO functionality is limited (UnityWebRequest required to download from persistant data to a temp file before System.IO can be used to load a file)

  • (WebAssembly) WebGL, everything in System.Threading and System.Threading.Tasks is unusable

  • (WebAssembly) WebGL, all file operations and streams are unusable, UnityWebRequest for IO or Session/Cookies.

  • (NetStandard2) System.Buffers unusable within Unity on all platforms

  • (NetStandard2) System.Memory - depends on System.Buffers.

  • (NetStandard2) System.Text.Json unusable within Unity on all platforms

  • Other .Net assemblies require csc.rsp file edits by hand.

Originally created by @codiemorgan on GitHub (Feb 12, 2021). As per the title, I am wondering if we may get NetStandard2.0 builds of MarkDig which do not reference **System.Memory**, or a build conditional which could be implemented to allow building from source to allow for builds which exclude optimizations which may rely on System.Memory and System.Buffers? This is primarily for compatibility within Unity and it's supported platform targets. To get around this, I currently use **CommonMark**, and intend to use it to to allow markdown formatting of In-game ui elements/quests, etc and to enable support for Markdown Files/Strings within unity's inspectors by translating HTML output into USS/UXML layouts. System.Memory is an obstacle if we wish to build for WebGL and Mobile Platforms within Unity using NetStandard2.0, but is possible (with additional setup) to use when targeting .NET4.X on standalone (Desktop) platforms. There are some other limitations which may affect Markdig compatibility with unity's NetStandard2 implementation (below). My hope is for a variant of Markdig which will function out of the box in when taking the following into account - Targeting .NetStandard2/NET461 within Unity (manual create and edit _csc.rsp_, not guaranteed for all platforms) - Net4.X: Minimum target is 4.6.1, maximum is a limited subset up to 4.7. - NetStandard: Only 2.0 is supported currently. - IL2CPP / AOT Platforms (with code stripping) - when using NetStandard2 while targeting WebGL - IL2CPP / AOT Platforms when targeting IOS/Android from within Unity (threading is possible). - Android: System.IO functionality is limited (UnityWebRequest required to `download` from persistant data to a temp file before System.IO can be used to load a file) - (WebAssembly) WebGL, everything in System.Threading and System.Threading.Tasks is unusable - (WebAssembly) WebGL, all file operations and streams are unusable, UnityWebRequest for IO or Session/Cookies. - (NetStandard2) System.Buffers unusable within Unity on all platforms - (NetStandard2) System.Memory - depends on System.Buffers. - (NetStandard2) System.Text.Json unusable within Unity on all platforms - Other .Net assemblies require **csc.rsp** file edits by hand.
claunia added the wontfix label 2026-01-29 14:36:36 +00:00
Author
Owner

@xoofx commented on GitHub (Feb 12, 2021):

As per the title, I am wondering if we may get NetStandard2.0 builds of MarkDig which do not reference System.Memory, or a build conditional which could be implemented to allow building from source to allow for builds which exclude optimizations which may rely on System.Memory and System.Buffers?

We don't want to rollback the work that was done to improve performance, nor we want to maintain special case for older/constrained frameworks.

But you should be able to use this old version 0.18.3 of Markdig which didn't have these dependencies in netstandard 2.0.

@xoofx commented on GitHub (Feb 12, 2021): > As per the title, I am wondering if we may get NetStandard2.0 builds of MarkDig which do not reference System.Memory, or a build conditional which could be implemented to allow building from source to allow for builds which exclude optimizations which may rely on System.Memory and System.Buffers? We don't want to rollback the work that was done to improve performance, nor we want to maintain special case for older/constrained frameworks. But you should be able to use this old version [0.18.3 of Markdig](https://www.nuget.org/packages/Markdig/0.18.3) which didn't have these dependencies in netstandard 2.0.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#435