SQLProvider
SQLProvider copied to clipboard
Compilation issue with .net core 3.1
Describe the bug
When trying to get the type of the DB using type Db = SqlDataProvider<...>, VS throws
Error FS3033 The type provider 'FSharp.Data.Sql.SqlTypeProvider' reported an error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information..
I've been looking around for a fix to this issue and despite trying all the solutions I found (mostly adding references or dlls to the resPath), I can't get it to work. Tried following the tutorial here as well, but I get the exact same error.
There seem to be a mismatch between the dlls referenced by the package and the ones that were downloaded with it. See screenshot below.
To Reproduce This tutorial does it for me.
Expected behavior Compiles without errors
Screenshots


Desktop (please complete the following information):
- OS: Windows 10
- Visual studio 2019 (also doesn't work in CLI or VS Code)
Additional Info
I use a folder called /lib for the additional dlls (resPath), in which I have Npgsql.dll, System.Data.Common.dll, System.Runtime.CompilerServices.Unsafe.dll and System.Threading.Tasks.Extensions.dll.
I haven't had any issues targeting .NET Core 3.1. Looking at my project dependencies I do see some differences:

In development I targeted a localdb mssql instance, and it targets mssql in production.
Don't know if any of that is helpful, but hopefully it is!
There has been some issues with System.Data.SqlClient on .Net Core 3.1, so there is the dynamic version: https://github.com/fsprojects/SQLProvider/issues/645#issuecomment-639163535
Should be fixed already