scripts don't recognize FSharp.Data

烈酒焚心 提交于 2019-12-01 16:15:08

Add a reference in the script to the nuget packages folder that contains FSharp.Data.dll. That folder also contains the designer dll (FSharp.Data.DesignTime.dll)

#r @"<your nuget packages folder>\FSharp.Data.2.1.0\lib\net40\FSharp.Data.dll"

Incidentally, I was just debugging this error last week. There are essentially three possible reasons:

  • The file could not be found. The most obvious one is that F# actually cannot find the dll file. Make sure the reference is correct (check References in the project properties) or make sure your #r points to the right file (when using an F# script file)

  • Type provider is not trusted. The type provider is blocked by Visual Studio. This can happen if you click on "Disable" when you load the provider for the first time. To fix this, go to "Tools" - "Options" - "F# Tools" - "Type Providers" and enable the type provider (check "Trusted").

  • The DLL is blocked by OS. Finally, if the dll comes from an untrusted source, Windows might block it (this happens especially if you download a zip file and extract the file using Windows). To unblock the file, go to file properties and click "Unblock". There is a good description here..

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!