使用F#(FSharp.Core 4.3.4)使用.NET Core 2.1键入Provider

Moo*_*oon 9 f# type-providers .net-core

我们刚刚从.NET Core 2.0升级到.NET Core 2.1.我们可以使用Visual Studio 2017构建和发布我们的项目,但是我们无法使用.NET Core的CLI来实现.SDK版本是2.1.300,这是我们在运行"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
Run Code Online (Sandbox Code Playgroud)

F#是否与.NET Core 2.1不兼容?我知道.NET Core 2.1上周刚刚发布,但我无法找到任何关于.NET Core 2.1支持的F#的声明.我发现最接近的是一篇MSDN博客文章,其中指出"从.NET Core 2.0和.NET Standard 2.0的发布开始,我们为.NET Core 2.0中的F#支持所做的所有更改都将与收件箱一起使用.NET Core SDK和.NET Core CLI".

Asi*_*sik 1

看起来这是 ExcelProvider 本身的问题,正如 Don Syme 在相关 github 问题上指出的那样:

ExcelProvider 尚未更新为能够作为 .NET Core 工具链的一部分运行。最好在 ExcelProvider 站点上记录问题,然后在新项目文件上使用 msbuild 而不是 dotnet https://github.com/Microsoft/visualfsharp/issues/5115#issuecomment-395101966