Skip to content
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

Dll hardcoded dependencies on Newtonsoft.Json Google.DataTable.Net.Wrapper #87

Closed
fradav opened this issue Sep 14, 2019 · 5 comments
Closed

Comments

@fradav
Copy link

fradav commented Sep 14, 2019

On latest offical dotnet .core 2.2.402,
If we either try to Chart.Show a XPlot.Plotly it barfs with :

System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'. Le fichier spécifié est introuvable.
File name: 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'
   at XPlot.Plotly.PlotlyChart.GetInlineHtml()
   at XPlot.Plotly.PlotlyChart.GetHtml()
   at XPlot.Plotly.PlotlyChart.Show()
   at <StartupCode$FSI_0005>.$FSI_0005.main@()

Or a XPlot.GoogleCharts :

System.IO.FileNotFoundException: Could not load file or assembly 'Google.DataTable.Net.Wrapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null'. Le fichier spécifié est introuvable.
File name: 'Google.DataTable.Net.Wrapper, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null'
   at XPlot.GoogleCharts.GoogleChart.GetInlineJS()
   at XPlot.GoogleCharts.GoogleChart.GetHtml()
   at XPlot.GoogleCharts.GoogleChart.Show()
   at <StartupCode$FSI_0006>.$FSI_0006.main@()

I don't know what exactly could do this, I tried to rebuild myself with no change.

@zyzhu
Copy link
Contributor

zyzhu commented Sep 17, 2019

I've tried it on windows with dotnet cli 2.2.402 and it worked. What's your environment?

App.fsproj

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.2</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <Compile Include="Program.fs" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="XPlot.GoogleCharts" Version="2.0.0" />
  </ItemGroup>

</Project>

Program.fs

// Learn more about F# at http://fsharp.org

open System
open XPlot.GoogleCharts

let sales = ["2013", 1000; "2014", 1170; "2015", 660; "2016", 1030]
let expenses = ["2013", 400; "2014", 460; "2015", 1120; "2016", 540]

let options =
    Options(
        title = "Company Performance",
        hAxis =
            Axis(
                title = "Year",
                titleTextStyle = TextStyle(color = "#333")
            ),
        vAxis = Axis(minValue = 0)
    )

[<EntryPoint>]
let main argv =
    [sales; expenses]
    |> Chart.Area
    |> Chart.WithLabels ["Sales"; "Expenses"]
    |> Chart.WithOptions options
    |> Chart.Show
    printfn "Hello World from F#!"
    0 // return an integer exit code

@fradav
Copy link
Author

fradav commented Sep 17, 2019

Sorry I forgot to say it's with dotnet fsi

@zyzhu
Copy link
Contributor

zyzhu commented Sep 18, 2019

I still use fsi under the old dotnet framework project setting that has locally installed Nuget packages. I need to reference each dlls using #r.

I do not know how to reference external Nuget packages in dotnet fsi yet. I hope it will work smoothly once this pull comes to official dotnet release
dotnet/fsharp#5850

@cartermp
Copy link
Collaborator

cartermp commented Nov 8, 2019

These are issues with dotnet fsi and transitive .dll references. It's completely gone with #r "nuget:..." implemented, which you can use in the Jupyter notebooks environment here: https://mybinder.org/v2/gh/dotnet/try/master?urlpath=lab

@cartermp cartermp closed this as completed Nov 8, 2019
@cartermp
Copy link
Collaborator

cartermp commented Nov 8, 2019

Link to Binder added to README here: https://github.com/fslaborg/XPlot#try-it-out

You can expect F# 5.0/.NET 5.0 to have a local dotnet fsi experience without issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants