首页 > 解决方案 > F# 加载程序集时出现问题:“无法加载一种或多种请求的类型”

问题描述

我是 F# 和 Visual Studio 的新手,我正试图找出问题所在。我正在尝试使用 SqlDataProvider。我的代码:

module HelloSquare


open System
open FSharp.Data.Sql

let square x = x * x

type PortalProd = SqlDataProvider<
                Common.DatabaseProviderTypes.MYSQL,
                "Server=localhost;Database=test;User=test;Password=test;",
                UseOptionTypes=true>

[<EntryPoint>]
let main argv =
    let test = 12312
    printfn "%d squared is: %d!" 12 (square 12)
    0 // Return an integer exit code   

我得到的错误是:

Error FS3033: The type provider 'FSharp.Data.Sql.SqlTypeProvider' reported an error: Unable to load one or more of the requested types.Could not load file or assembly 'Google.Protobuf, Version=3.5.1.0, Culture=neutral, PublicKeyToken=APublicKey'.

我使用 nuget 添加了 protobuf,但错误仍然存​​在。

在此处输入图像描述

希望这很简单,但我可以使用一些帮助。

macOS High Sierra 10.13.6 Visual Studio Community 2019 for Mac 版本 8.0.1(内部版本 1)

标签: f#visual-studio-2019

解决方案


推荐阅读