Open mvperez opened 5 years ago
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. I think the issue(s) I had were path related (self inflicted), but I just kept tweaking it until I got the needed dll to show up in my build artifacts.
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
@Thorium Is this an issue with system.data.sqlclinet? If so should we be putting an issue in with that repo
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: https://github.com/fsprojects/SQLProvider/issues/645#issuecomment-639163535
@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
let [] dbVendor = Common.DatabaseProviderTypes.MSSQLSERVER
let [] connString = "Server=localhost;Database=accountgo;User Id=sa;Password=Str0ngPassword;"
let [] indivAmount = 1000
let [] useOptTypes = true
type sql = SqlDataProvider< DatabaseVendor = dbVendor, ConnectionString = connString, IndividualsAmount = indivAmount, UseOptionTypes = useOptTypes>
[]
let main argv =
let ctx = sql.GetDataContext()
ctx.Dbo.Company.Individuals.
1
|> printf "%A" 0 // return an integer exit codeOS Name: Mac OS X OS Version: 10.14 OS Platform: Darwin RID: osx-x64 Base Path: /usr/local/share/dotnet/sdk/2.1.401/
Host (useful for support): Version: 2.1.3 Commit: 124038c13e
.NET Core SDKs installed: 2.0.0 [/usr/local/share/dotnet/sdk] 2.1.4 [/usr/local/share/dotnet/sdk] 2.1.401 [/usr/local/share/dotnet/sdk]