将 F# (FSharp.Core 4.3.4) 类型提供程序与 .NET Core 2.1 结合使用



我们刚刚从.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:UsersXXX.nugetpackagesexcelprovider.8.2libExcelProvider.dll' has assembly level attribute 'Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute' but no public type provider classes were found

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一起内置"。

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

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

最新更新