从 F# 脚本使用 COM

Using COM from an F# script

如何从 F# 脚本使用 COM 库?有可能吗?如何在 .fsx 文件中引用所需的 COM 库?

更具体地说,我想从构建脚本中使用 InstallShield Automation。尽管我付出了所有努力,但我只能让它与常规编译项目一起使用。

编辑: 我已经尝试过 COM type provider project。但是,它似乎没有在我感兴趣的特定 COM 库中找到任何类型。如果它是一个错误或预期的行为,我不知道。

我认为 COM type provider 可能会帮助您:

One advantage of this method is that you can author and deploy F# scripts without having to pre-generate the interop assemblies. Another advantage is that you can easily explore all the COM components installed on your machine via intellisense.

是的,我只是 google it,OP 在此处询问之前也可能做过。