Skip to content

Typeprovider constructor error when built using dotnet from command prompt #154

Open

Description

@priv22

The type provider 'FSharp.Configuration.ConfigTypeProvider+FSharpConfigurationProvider' reported an error : The type provider constructor has thrown an exception: System.Runtime.Caching is not supported on this platform.

I am figuring out F#... I can build it and run it without errors in Visual Studio. But when I try to build it from the command prompt using dotnet build, I get the above error.

Advise please

Activity

  1. Shmew commented on Dec 6, 2019

    @Shmew

    It doesn't look like this is maintained any longer. It's not currently targeting dotnet core, so it will only work with framework applications.

  2. sergey-tihon commented on Dec 7, 2019

    @sergey-tihon
    Member

    What version of TP and run do you use ?
    FSharp.Configuration 2.0.0-alpha2 should work on .NET Core

  3. eacasanovaspedre commented on Dec 11, 2019

    @eacasanovaspedre

    It's still failing on MacOs. I managed to use FSharp.Configuration on Windows using 2.0.0-alpha2 and the workaround for Type Providers with the file fsc.props. But still it won't compile on MacOs.
    When I add the file fsc.props the error I get is:
    FSC : error FS0226: The file extension of '/usr/local/share/dotnet/sdk/3.1.100/FSharp/fsc.exe' is not recognized. Source files must have extension .fs, .fsi, .fsx, .fsscript, .ml or .mli.

  4. rbauduin commented on Dec 21, 2019

    @rbauduin

    On Linux, using dotnet code 3.1, ionide reports this error:

    The type provider 'FSharp.Configuration.ConfigTypeProvider+FSharpConfigurationProvider' reported an error: The type provider constructor has thrown an exception: System.Runtime.Caching is not supported on this platform.F# Compiler(3053)
    Referenced assembly '/home/rb/.nuget/packages/fsharp.configuration/2.0.0-alpha2/lib/netstandard2.0/FSharp.Configuration.dll' has assembly level attribute 'Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute' but no public type provider classes were foundF# Compiler(3005)
    

    I can compile it without error from the command line, but I'm not sure which is the correct behaviour.

  5. drk-mtr commented on Mar 5, 2020

    @drk-mtr

    This doesn't happen when using Visual Studio 2019. It only occurs when using vscode or neovim with Ionide. I couldn't try the (non-Ionide) F# Language Server in vscode since that appears to be broken. And I don't have Rider (unfortunately!).

    I have the same issue on MacOS, Windows and Linux using version 2.0.0-alpha2 and dotnet 3.1.102 (also 2.1.300). This is when referencing the package, it doesn't need an open statement to raise the error.

    I imagine this is why it works for Sergey but not for others...

    I wonder whether we should we be raising this in the FSAC or Ionide repos instead?

    Just repeating the error messages here without scrollbars for legibility:

    The type provider 'FSharp.Configuration.ConfigTypeProvider+FSharpConfigurationProvider' reported an error: The type provider constructor has thrown an exception: System.Runtime.Caching is not supported on this platform. F# Compiler(3053)

    Referenced assembly 'C:\Users\usrname\.nuget\packages\fsharp.configuration\2.0.0-alpha2\lib\netstandard2.0\FSharp.Configuration.dll' has assembly level attribute 'Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute' but no public type provider classes were found. F# Compiler(3005)

  6. baronfel commented on Mar 5, 2020

    @baronfel
    Collaborator

    There's an issue in ionide that I've referenced in ionide/FsAutoComplete#565, that I believe is related. It's on my radar, trying to see when I'll have time to investigate.

  7. drk-mtr commented on Mar 5, 2020

    @drk-mtr

    Ah good to hear - thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions