-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Win7, VSCode, F# Interactive. Could not load file or assembly 'System.Windows.Forms.DataVisualization" #150
Comments
Do we have an update on this error? FSharp.Charting is unusable in interactive at the moment. I've tried to load the missing dll with this input at the start of the program: |
You're running F# Interactive for .net core. You will need to use .net framework. I believe only Visual Studio has a legacy switch for running fsi for .net framework from the IDE. You can run it from the command line using "fsi" from a vs2022 developer prompt. I don't know if System.Windows.Forms.DataVisualization.dll is available for netcoreapp/net5/6, if it is we could add support for that |
Looks like it's all considered deprecated for netcore, unless someone else is maintaining a fork. https://github.com/dotnet/winforms-datavisualization Still there is a partial nuget available. Perhaps it's enough to use in practice |
Thanks @dsyme, the fsi command in vs2022 developer prompt is doing the job. I'll let the Interactive programming aside for now. |
FWIW, I am able to use the copy of |
The menu issue is solved - in net core apps let menu = new ContextMenuStrip()
let dlg = new SaveFileDialog(Filter = "PNG (*.png)|*.png|Bitmap (*.bmp;*.dib)|*.bmp;*.dib|GIF (*.gif)|*.gif|TIFF (*.tiff;*.tif)|*.tiff;*.tif|EMF (*.emf)|*.emf|JPEG (*.jpeg;*.jpg;*.jpe)|*.jpeg;*.jpg;*.jpe|EMF+ (*.emf)|*.emf|EMF+Dual (*.emf)|*.emf")
let miCopy = new ToolStripMenuItem("&Copy Image to Clipboard", ShortcutKeys = (Keys.Control ||| Keys.C))
let miCopyEmf = new ToolStripMenuItem("Copy Image to Clipboard as &EMF", ShortcutKeys = (Keys.Control ||| Keys.Shift ||| Keys.C))
let miSave = new ToolStripMenuItem("&Save Image As..", ShortcutKeys = (Keys.Control ||| Keys.S))
let miEdit = new ToolStripMenuItem("Show Property &Grid", ShortcutKeys = (Keys.Control ||| Keys.G))
miEdit.Click.Add(fun _ ->
miEdit.Checked <- not miEdit.Checked
props.Visible <- miEdit.Checked)
miCopy.Click.Add(fun _ ->
srcChart.CopyChartToClipboard())
miCopyEmf.Click.Add(fun _ ->
srcChart.CopyChartToClipboardEmf(self))
miSave.Click.Add(fun _ ->
if dlg.ShowDialog() = DialogResult.OK then
let fmt =
match dlg.FilterIndex with
| 1 -> ChartImageFormat.Png
| 2 -> ChartImageFormat.Bmp
| 3 -> ChartImageFormat.Gif
| 4 -> ChartImageFormat.Tiff
| 5 -> ChartImageFormat.Emf
| 6 -> ChartImageFormat.Jpeg
| 7 -> ChartImageFormat.EmfPlus
| 8 -> ChartImageFormat.EmfDual
| _ -> ChartImageFormat.Png
chart.SaveImage(dlg.FileName, fmt |> int |> enum) )
menu.Items.Add(miCopy) |> ignore
menu.Items.Add(miCopyEmf) |> ignore
menu.Items.Add(miSave) |> ignore
menu.Items.Add(miEdit) |> ignore
self.ContextMenuStrip <- menu |
It seems this issue is still ongoing. I just got the following error with
With
This was from the following piece of code both in "foo.dib" and "foo.fsx" on Windows.
|
Hello, All!
As far as I understand, System.Windows.Forms.DataVisualization is a system assembly. You don't need to explicitly refer to it. Why FSharp.Charting can't find an assembly? See attachment.
What am I doing wrong?
The text was updated successfully, but these errors were encountered: