fsprojects / ExcelProvider

This library is for the .NET platform implementing a Excel type provider.
http://fsprojects.github.io/ExcelProvider/
The Unlicense
141 stars 51 forks source link

Getting Started: Unable to find the file 'ExcelProvider.dll' #90

Closed jim108dev closed 2 years ago

jim108dev commented 2 years ago

Description

I have followed the steps on the "Getting Started" page. I am stuck because I don't know how to provide 'ExcelProvider.dll'.

Repro steps

  1. Create new directory excel_provider.
  2. Paket: Add Nuget Package: "ExcelProvider".
  3. Paket: Generate Load Scripts
  4. Create Test code file main.fsx with code from "Getting Started" page

    // reference the type provider dll
    #r "ExcelProvider.dll"
    open FSharp.Interop.Excel
    
    // Let the type provider do it's work
    type DataTypesTest = ExcelFile<"DataTypes.xlsx">
    let file = new DataTypesTest()
    let row = file.Data |> Seq.head
    let test = row.Float
  5. Running interactive shell leads to an error.

Expected behavior

No error or instructions what to do.

Actual behavior

  #r "ExcelProvider.dll"
  ^^^^^^^^^^^^^^^^^^^^^^

/home/a/github/excel_provider/stdin(2,1): error FS0078: Unable to find the file 'ExcelProvider.dll' in any of
 /usr/share/dotnet/shared/Microsoft.NETCore.App/5.0.11
 /usr/share/dotnet/shared/Microsoft.NETCore.App/5.0.11/../../../packs/Microsoft.NETCore.App.Ref/5.0.0/ref/net5.0
 /home/a/github/excel_provider
 /usr/share/dotnet/sdk/5.0.402/FSharp/

Known workarounds

Related information

Thank you!

quintusm commented 2 years ago

HI @jim108dev

I apologize. The issue you are experiencing is due to outdated documentation predating my involvement with the project. Fixing this is next on my to-do list. With new versions of fsi and netcore you can do a reference directly to the nuget package i.e.: `

r "nuget: ExcelProvider"

`

Alternatively you need to reference the ExcelProvider.Runtime.dll instead of just ExcelProvider i.e. #r "ExcelProvider.Runtime.dll"

Hope that helps. If not, please reply again and I will assist.

jim108dev commented 2 years ago

Thank you @quintusm! I realized ExcelProvider does not write to Excel. Best wishes!