Skip to content

Delegates with generic error: The generic type 'System.Func`4' was used with an invalid instantiation in assembly  #826

@bnuzhouwei

Description

@bnuzhouwei

I use SixLabors.ImageSharp to preprocess image, but got

System.TypeLoadException: The generic type 'System.Func`4' was used with an invalid instantiation in assembly 'System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'.

The code is:

    paddedHeight = int(System.Math.Ceiling(image.Height / 32.0) * 32.0)
    paddedWidth = int(System.Math.Ceiling(image.Width / 32.0) * 32.0)
    def processPixels(accessor):
        for y in range(paddedHeight-accessor.Height, accessor.Height):
            pixelSpan = accessor.GetRowSpan(y)
            for x in range(paddedWidth-accessor.Width, accessor.Width):
                pass
    delegate = SixLabors.ImageSharp.PixelAccessorAction[SixLabors.ImageSharp.PixelFormats.Rgb24](processPixels)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions