question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is this meant to work with dotnet core? (System.Text.Encoding.CodePages dependency error)

See original GitHub issue

I’m new to F# so this may well be user error…

Description

I get the following error when trying to run a simple solution:

error FS3033: The type provider 'FSharp.Interop.Excel.ExcelProvider.ProviderImplementation+ExcelProvider' reported an error: Could not load file or assembly 'System.Text.Encoding.CodePages, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Could not find or load a specific file.

I was going to log as an issue but I’m not sure whether the ExcelProvider is actually meant to work on .net core yet?

Known workarounds

Use full framework? Code works fine when running from .fsx, and intellisense (Ionide in vscode) is working correctly at design time.

Related information

  • Using ExcelProvider 1.0.1.
  • Tried with dotnet SDK versions 2.2.202 and 3.0.100-preview3-010431.
  • Tried specifying TargetFramework of netcoreapp2.1 and netcoreapp3.0 respectively in .fsproj.
  • Tried manually referencing System.Text.Encoding.CodePages in solutions using both the dotnet add package ... and paket add ... with local /packages folder approaches.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
drk-mtrcommented, May 13, 2019

Thanks for the help! Unfortunately I can’t get that working, but I may have misunderstood where I need to register it. I’ve tried this:

open FSharp.Interop.Excel
open System.Text

type Xl = ExcelFile<"Book1.xlsx">

[<EntryPoint>]
let main argv =

    Encoding.RegisterProvider(CodePagesEncodingProvider.Instance)
    let xl = Xl().Data
    printfn "%s" (xl |> Seq.map (fun s -> s.test1.ToString()) |> String.concat "" )

    0

Also tried moving the Encoding... line outside of the main method and putting do in front of it but no joy.

0reactions
quintusmcommented, Sep 4, 2021

This issue should be resolved with Version 2.0.0 release which is only targeting netstandard 2.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

EPPlus: System.Text.Encoding.CodePages.dll not found in ...
CodePage.dll after you put it in the bin folder. It's not your fault, I think this is a design error of the azure...
Read more >
System.Text.Encoding.CodePages 7.0.0
Provides support for code-page based encodings, including Windows-1252, Shift-JIS, and GB2312. Commonly Used Types: System.Text.CodePagesEncodingProvider.
Read more >
Could not load file or assembly 'System.Text.Encoding. ...
This project has been developed for .NET framework 4.6.1. Now we have to update it to target 4.7.2 but we are facing a...
Read more >
CodePagesEncodingProvider Class (System.Text)
Provides access to an encoding provider for code pages that otherwise are available only in the desktop .NET Framework.
Read more >
Nuget package installer does not install dependencies (.net ...
I have a test project, wherin I'm using PeanutButter.TempDb.MySql (I'm also the owner/maintainer of the PeanutButter.* packages). This package depends on:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found