Skip to content

Error using System.Drawing.Common with FSI #12023

Description

@tarekgh

Issue moved from dotnet/runtime#57922


From @auslavs on Monday, August 23, 2021 8:01:05 AM

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions