F# Mono不';找不到ExcelProvider.dll

F# Mono不';找不到ExcelProvider.dll,f#,F#,我在MacOS上安装了ExcelProvider(运行F#4.5和mono 6.0.0.327) 现在,我创建了一个空目录,创建了一个名为Foo.fs的文件,并编写了以下代码 open FSharp.Interop.Excel type DataTypeTest = ExcelFile<"DataTypeTest.xlsx"> let file = new DataTypeTest() let row = file.Data |> Seq.head printfn "This

我在MacOS上安装了ExcelProvider(运行F#4.5和mono 6.0.0.327)

现在,我创建了一个空目录,创建了一个名为Foo.fs的文件,并编写了以下代码

open FSharp.Interop.Excel
type DataTypeTest = ExcelFile<"DataTypeTest.xlsx">
let file = new DataTypeTest()
let row = file.Data |> Seq.head
printfn "This is column 1 %s" row.Test1
printfn "This is column 2 %s" row.Test2
这很好,我得到了Foo.exe

现在我命令mono能够找到我的Excel提供程序Dll。我创建了一个名为Foo.exe.config的配置文件,并复制了以下内容

<configuration>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <providing privatePath="/Users/srabh/ExcelProvider.1.0.1/lib/netstandard2.0" />
        </assemblyBinding>
    </runtime>
</configuration>

您需要在配置文件中添加have
probling privatePath
,并在应用程序的目录或子目录中添加dll。请参阅:


实际上最好不要直接使用编译器或msbuild,因为您很快就会遇到问题(正如您所注意到的)。相反,plz使用Rider/VS Code/VS(它们都在mac上运行)。它将简化包管理、构建和维护项目。如果您选择将ionide扩展安装到VSCode中

您可能应该使用VS/Rider/VS代码来创建项目,这样您就可以避免此类手动干预。你的意思是探测私密路径吗?这将搜索应用程序的基本目录,因此我建议尝试将dll移动到那里。如果您的包在缓存中,那么使用``我只是在Mac上使用VSCode。我没有访问“大”visual studio的权限。没问题。你用fsharp和paket安装了ionide吗?我刚做了“brew安装mono”,然后分别安装了vscode。不谈论Ionide或packet。我遵循了本文档中的“选项5:通过自制(64位)使用Mono安装F#”。
fsharpc -r:/Users/foo/ExcelProvider.1.0.1/lib/netstandard2.0/ExcelProvider.Runtime.dll -o:Foo.exe Excel.fs
<configuration>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <providing privatePath="/Users/srabh/ExcelProvider.1.0.1/lib/netstandard2.0" />
        </assemblyBinding>
    </runtime>
</configuration>
Unhandled Exception:
System.IO.FileNotFoundException: Could not load file or assembly 'ExcelProvider.Runtime, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
File name: 'ExcelProvider.Runtime, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load file or assembly 'ExcelProvider.Runtime, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
File name: 'ExcelProvider.Runtime, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'