Skip to content

Error using System.Drawing.Common with FSI #57922

@auslavs

Description

@auslavs

When calling System.Drawing.Common within FSharp Interactive, the assembly cannot be loaded

error FS0193: Could not load file or assembly 'System.Drawing.Common, Version=5.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.

Repro fsx script for the error:

#r "nuget: System.Drawing.Common, 5.0.2"

open System.IO
open System.Drawing

let getBitmapWidth =
  use stream = new FileStream("image.jpg",FileMode.Open,FileAccess.Read)
  use bm = new Bitmap(stream)
  bm.Width

FSI version details:

Microsoft (R) F# Interactive version 11.4.2.0 for F# 5.0

Metadata

Metadata

Assignees

No one assigned

    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