-
Notifications
You must be signed in to change notification settings - Fork 146
Unhandled Exception: System.TypeLoadException: Could not load type 'System.Data.SqlClient.SqlConnection' #580
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You need a post build step to ensure the needed dll is present at runtime. It took me a little bit to get it working properly in my project, but looking at issue #462 was helpful. Also, in case you haven't seen it already, this is mentioned in the docs here. http://fsprojects.github.io/SQLProvider/core/netstandard.html#Microsoft-Sql-Server |
I saw something like this with SQLProvider 1.1.52, I reverted to 1.1.49 which fixed the issue. Could you try that version? see if we are having the same problem? I'm using Postgres, not MSSQL. |
Try adding references to System.Data and System.Data.SqlClient |
I am having this same issue with a similar Runtime Environment as the OP, however I am using Paket. EDIT: Actually I am receiving this error when trying to build my app |
I'm not sure how well System.Data.SqlClient supports .NET Core 3.1. However, this can also be SQLProvider not finding correct dlls when doing reflection loading. I have only Windows environment near, but this works for me: |
@Thorium you can get docker for windows and run Linux container builds locally. that is what I'm doing before pushing up to are linux server. Let me know if there is anything I can do to help out |
was this resolved? i also got this error from macos in .fsx dotnet6 |
Description
I'm getting this error when I execute "dotnet run"
But I can successfully build the solution/project "dotnet build".
Here is my .csproj file
I'm not sure if I need this line, but with without it same output.
But these lines seems important as I am getting other errors without it. Why I need this? This looks my project can't be run on windows.
Mono is already in my PATH
PATH=/Users/Marvs/.cargo/bin:~/Library/Python/2.7/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/Marvs/source/go/bin:/Users/Marvs/bin:/Library/Frameworks/Mono.framework/Versions/Current/bin/
Repro steps
Please provide the steps required to reproduce the problem
Create a solution and F# console project
Add SQLProvider package to F# console project. "dotnet add package SQLProvider --version 1.1.52"
Add these lines
Expected behavior
NO Unhandled Exception: System.TypeLoadException: Could not load type
Actual behavior
Unhandled Exception
Known workarounds
Please provide a description of any known workarounds.
Related information
.NET Core SDK (reflecting any global.json):
Version: 2.1.401
Commit: 91b1c13032
Runtime Environment:
The text was updated successfully, but these errors were encountered: