Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using F# (FSharp.Core 4.3.4) Type Provider with .NET Core 2.1

We've just upgraded from .NET Core 2.0 to .NET Core 2.1. We're able to build and publish our project using Visual Studio 2017, but we're unable to do so using the CLI of .NET Core. The SDK version is 2.1.300, and this is what we get while running "dotnet publish":

error FS3053 : The type provider 'ExcelProvider.ExcelProvider+ExcelProvider' reported an error : The type provider constructor has thrown an exception: Exception has been thrown by the target of an invocation.
FSC : warning FS3005: Referenced assembly 'C:\Users\XXX\.nuget\packages\excelprovider\0.8.2\lib\ExcelProvider.dll' has assembly level attribute 'Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute' but no public type provider classes were found

Is F# by any means incompatible with .NET Core 2.1? I know that .NET Core 2.1 has just been released last week, but I couldn't find anywhere a statement about F# being supported by .NET Core 2.1. The closest thing I found is an MSDN blog post which states that "starting with the release of .NET Core 2.0 and .NET Standard 2.0, all of the changes we have made for F# support in .NET Core 2.0 will be in-box with the .NET Core SDK and .NET Core CLI".

like image 472
Moon Avatar asked Jun 06 '18 11:06

Moon


People also ask

What is F used for in Python?

Python f-strings provide a faster, more readable, more concise, and less error prone way of formatting strings in Python. The f-strings have the f prefix and use {} brackets to evaluate values. Format specifiers for types, padding, or aligning are specified after the colon character; for instance: f'{price:.

What is the F string?

In Python source code, an f-string is a literal string, prefixed with 'f', which contains expressions inside braces. The expressions are replaced with their values.

How do you make an F string table in Python?

F-String Table in Python. You can specify the number of spaces taken by each variable inside your F-string. To do this, add a :{} after the variable name inside the F-string, and specify the number of spaces taken inside the curly braces.


Video Answer


1 Answers

Looks like this is an issue with the ExcelProvider itself, as noted by Don Syme on the related github issue:

The ExcelProvider has not yet been updated to be able to run as part of the .NET Core toolchain. Best to log an issue on the ExcelProvider site, until then use msbuild over your new project files instead of dotnet https://github.com/Microsoft/visualfsharp/issues/5115#issuecomment-395101966

like image 144
Asik Avatar answered Oct 24 '22 08:10

Asik