如何在F#interactive中加载本机DLL?

如何在F#interactive中加载本机DLL?,f#,interop,f#-interactive,F#,Interop,F# Interactive,尝试使用Microsoft.TeamFoundationServer.ExtendedClientnuget软件包时,出现以下错误: System.DllNotFoundException: Unable to load DLL 'Microsoft.WITDataStore32.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) 这是因为包中包含的一个DLL是本机DLL,无法使

尝试使用
Microsoft.TeamFoundationServer.ExtendedClient
nuget软件包时,出现以下错误:

System.DllNotFoundException: Unable to load DLL 'Microsoft.WITDataStore32.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
这是因为包中包含的一个DLL是本机DLL,无法使用在F#interactive(
#r“dllname.DLL”
)中加载DLL的正常方式进行引用


如何加载或帮助F#interactive查找本机DLL?

所需的只是确保FSI进程在包含本机DLL的目录中查找DLL。你不需要直接引用它

实现这一点的一种方法是将其添加到系统路径:

Environment.SetEnvironmentVariable(“路径”,
Environment.GetEnvironmentVariable(“Path”)+“+”源目录“+”\..\packages\Microsoft.TeamFoundationServer.ExtendedClient.15.112.1\lib\native\x86\”

有关其他一些选项的说明,请参见: