No se puede compilar un proyecto de F# con ApiaryTypeProvider. FSharp.Data.DesignTime no se puede encontrar

I have an F# Library Project ( Not Portable Library ) with the following code:

   let db = new ApiaryProvider<"themoviedb">("")
   db.AddQueryParam("api_key", TmdbApiKey)
   let test = 
      let movie = db.Movie.GetMovie("550")
      let creds = movie.Credits()

Unfortunately when I try to build this I get the error:


error FS3033: The type provider 'ApiaryProvider.ProviderImplementation.ApiaryProvider'
reported an error in the context of provided type
'ApiaryProvider.ApiaryProvider,ApiName="themoviedb"+Movie3', member 'Credits'.

The error: Could not load file or assembly 'FSharp.Data.DesignTime, Version=,
Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find
the file specified.

En la línea:

let credits = movie.Credits()

I'm using the ApiaryProvider 1.0.1. The FSharp.Data.DesignTime dlls are in the nuget packages file in this directory:


I read on this question here: ¿Es FSharp.Data.DesignTime .NET 4.5 solamente?

That you can remove the reference and it should work but this mentions FSharp.Data and that it should be fixed in the new nuget packages.

Am I doing something wrong? Do I need to checkout the source code and manually remove the reference and rebuild?

preguntado el 28 de mayo de 14 a las 11:05

Can you try copying all files from the lib/net40 directorio de la FSharp.Data package to the directory where ApiaryProvider.dll ¿es? -

Hi Tomas. Thanks for the response. I've copied all the files from FSharp.Data.2.0.7/lib/net40 to Apiary.1.0.1 /lib/net40. Now when I build I get the error: parse error FS3053: error : The type provider constructor has thrown an exception: API restriction: The assembly 'file:///C:\Users\Andy\Documents\Programming\Projects\MovieMediaManager\packages\FSharp.Data.2.0.7\lib\net40\FSharp.Data.dll' has already loaded from a different location. It cannot be loaded from a new location within the same appdomain. -

It also seems to leak memory somewhat. VS2013 slows down after a little usage and shows as using 80% memory and needs restarting. This isn't using interactive. Just building and running a project using the provider. -

1 Respuestas

I have ran into a couple issues with f# and the FSharp.Data.Dll myself. I had to completely unisntall the package from every project in the solution and then reinstall the nuget package. I then had to go to Tools, Options, F# Tools, type providers and trust the FSharp.Data.DLL for the project you are currently working on. I have also had issues with the DLL being trusted for multiple projects at once and it causes issues as well.

¡Espero que esto ayude!

Respondido el 30 de junio de 14 a las 17:06

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.