You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Typeprovider constructor error when built using dotnet from command prompt #154
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.
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.
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.
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)
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.
Activity
Shmew commentedon Dec 6, 2019
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.
sergey-tihon commentedon Dec 7, 2019
What version of TP and run do you use ?
FSharp.Configuration 2.0.0-alpha2 should work on .NET Core
eacasanovaspedre commentedon Dec 11, 2019
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.
rbauduin commentedon Dec 21, 2019
On Linux, using dotnet code 3.1, ionide reports this error:
I can compile it without error from the command line, but I'm not sure which is the correct behaviour.
drk-mtr commentedon Mar 5, 2020
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-alpha2and dotnet3.1.102(also2.1.300). This is when referencing the package, it doesn't need anopenstatement 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)baronfel commentedon Mar 5, 2020
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.
drk-mtr commentedon Mar 5, 2020
Ah good to hear - thanks!