Skip to content

MethodNotFoundException when printing images #298

@cactusjack66

Description

@cactusjack66

I used ESC-POS_NET (Version 3.0.0) in .NET8.0 with ImageSharp Version 2.1.11.
Then I upgraded to .NET9.0 and ImageSharp Version 3.1.11.

Now I get a MethodNotFoundException when calling PrintImage.
The Exception occurs in BufferImage in line 390:

Image image2 = Image.Load(image):

System.MissingMethodException: Method not found: SixLabors.ImageSharp.Image`1<!!0> SixLabors.ImageSharp.Image.Load<!0>(byte[])
at ESCPOS_NET.Emitters.BaseCommandEmitter.PrintImage(Byte[] image, Boolean isHiDPI, Boolean isLegacy, Int32 maxWidth, Int32 color)

EDIT: So, it turned out, that ESCPOS can not be used with ImageSharp Version 3. I tried downgrading the ImageSharp Version to 2.1.12 and suddently it worked. Using Version 3 caused the Missing Method Exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions