SQLProvider icon indicating copy to clipboard operation
SQLProvider copied to clipboard

The type provider 'FSharp.Data.Sql.SqlTypeProvider' reported an error: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.  Could not load file or assembly 'Google.Protobuf, Version=3.6.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604' or one of its dependencies.

Open eperacchia opened this issue 6 years ago • 5 comments
trafficstars

Hello,

trying to connect MySql database to use TypeProviders on it, problem is, im getting this error when i run it.

 System.Exception: Operation could not be completed due to earlier error  The type provider 'FSharp.Data.Sql.SqlTypeProvider' reported an error: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.  Could not load file or assembly 'Google.Protobuf, Version=3.6.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604' or one of its dependencies.

Been looking for more issues like this, but could'nt find any.

Anybody can help?

`

 #r "FSharp.Data.SqlProvider.dll"

  open FSharp.Data.Sql

   let [<Literal>] ResPath = __SOURCE_DIRECTORY__ + 
   "/mysql.data.8.0.17/lib/net452/MySql.Data.dll"
   let [<Literal>] ConnString = "Server=localhost;Database=TestDB;Trusted_connection=true"
   let [<Literal>] DbVendor= Common.DatabaseProviderTypes.MYSQL

   type DbProvider = SqlDataProvider<DbVendor,ConnString,ResolutionPath = ResPath>

`

Im on Ubuntu, working with monodevelop

eperacchia avatar Oct 11 '19 14:10 eperacchia

You have to have the references, including the Google.Protobuf.dll in your ResPath.

However, I recommend using the other driver for MySql, it has a lot better performance than the official one.

Thorium avatar Oct 11 '19 14:10 Thorium

Thanks for your answer.

It's fine copy-pasting the Google.Protobuf.dll inside the ResPath containing the MySql.Data.dll?

The other drivers are the MySqlConnector?

eperacchia avatar Oct 11 '19 14:10 eperacchia

Yes. And yes.

Thorium avatar Oct 11 '19 15:10 Thorium

I changed the drivers, using MySqlConnector, added System.Buffers.dll, System.Runtime.InteropServices.RuntimeInformation.dll and System.Threading.Tasks.Extensions.dll to the same folder where MySqlConnector.dll is, but I'm still getting the same error. So I added the Google.Protobuf.dll to the ResPath folder, and still no good news.

I've used all the latest release of the .dll.

Could it be a monodevelop problem? The version of monodev is 7.8.2. Or should i work on Windows? I'm using Ubuntu right now.

eperacchia avatar Oct 11 '19 15:10 eperacchia

Ubuntu should be fine. Do you know if your dll version match the required one? Can you try older version of the connector if it would have less dependencies?

Thorium avatar Oct 12 '19 08:10 Thorium

This is fixed

Thorium avatar Nov 17 '23 08:11 Thorium