ILMerge icon indicating copy to clipboard operation
ILMerge copied to clipboard

Support types with embedded references?

Open tobinchan opened this issue 4 years ago • 0 comments

I use ILMerge with System.Memory.dll, and inside it the type Span<T> was merged out to be marked with Obsolete:

    [DebuggerDisplay("{ToString(),raw}")]
    [DebuggerDisplay("{ToString(),raw}")]
    [DebuggerTypeProxy(typeof(System.SpanDebugView<>))]
    [DebuggerTypeProxy(typeof(System.SpanDebugView<>))]
    [DefaultMember("Item")]
    [Obsolete("Types with embedded references are not supported in this version of your compiler.", true)]
    [System.Memory.IsByRefLikeAttribute]
    [System.Memory.IsReadOnlyAttribute]
    public struct Span<T> { ... }

Origin type is:

    [DebuggerDisplay("{ToString(),raw}")]
    [DebuggerDisplay("{ToString(),raw}")]
    [DebuggerTypeProxy(typeof(System.SpanDebugView<>))]
    [DebuggerTypeProxy(typeof(System.SpanDebugView<>))]
    [DefaultMember("Item")]
    public readonly ref struct Span<T> { ... }

Build error:

error CS0619: 'Span<T>' is obsolete: 'Types with embedded references are not supported in this version of your compiler.'

Can you help me work around this problem?

tobinchan avatar Feb 04 '21 13:02 tobinchan