2

I have a simple .NET Core console project on macOS with paket.dependencies

storage: symlink
source https://www.nuget.org/api/v2
nuget FsLab

and paket.references

FsLab

and program

open XPlot.Plotly
[<EntryPoint>]
let main argv =
    [1 .. 10] |> Chart.Line |> Chart.Show
    0

When I dotnet run it, I get the warning

warning NU1701: Package 'XPlot.Plotly 1.5.0' was restored using
'.NETFramework,Version=v4.6.1' instead of the project target framework
'.NETCoreApp,Version=v2.2'. This package may not be fully compatible with your
project.

and a bunch of similar ones, followed by the error

Unhandled Exception: System.ComponentModel.Win32Exception: Permission denied
at Interop.Sys.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setUser, UInt32 userId, UInt32 groupId, Int32& lpChildPid, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean shouldThrow)
at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at XPlot.Plotly.Html.showInBrowser(String html, String pageId)
at XPlot.Plotly.Chart.Show(PlotlyChart chart)
at Program.main(String[] argv)

It looks like it's trying to display the chart in the browser. I have three questions:

  1. What is going on?
  2. How can I get it to display in the browser?
  3. How can I programmatically export the chart to a file (e.g. a PNG)?
CarbonFlambe
  • 366
  • 1
  • 12
  • 2
    I was able to replicate the issue on Windows. It appears to have something to do with FsLab and .NET Core. – Wallace Kelly Jul 02 '19 at 12:21
  • Related? https://github.com/dotnet/cli/issues/8258 - Have a peek and see if you can run it without 4.6.1. Could be that its impossible, since its targeted for .netstandard and not for .netcore (https://github.com/fslaborg/XPlot/blob/master/src/XPlot.Plotly/XPlot.Plotly.fsproj#L4). – Caramiriel Jul 20 '19 at 07:52

0 Answers0