You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I am trying to establish a connection with PostgreSQL. Following this docs site: https://fsprojects.github.io/SQLProvider//core/postgresql.html I have copied Npgsql.dll in the chosen location and provided a path to this location as a ResolutionPath argument.
I have this code to achieve the connection:
`
module Postgresql =
open FSharp.Data.Sql
let [<Literal>] connectionString = "Host=localhost; Database=TestDb; Username=postgres;Password=postgres"
let [<Literal>] resolutionPath = @"C:\Users\%user%\source\repos\MySolution"
// create a type alias with the connection string and database vendor settings
type sql = SqlDataProvider<
ConnectionString = connectionString,
DatabaseVendor = Common.DatabaseProviderTypes.POSTGRESQL,
ResolutionPath = resolutionPath,
IndividualsAmount = 1000,
UseOptionTypes = Common.NullableColumnType.OPTION
>
let ctx = sql.GetDataContext()
`
The error that I get when trying to build the project (via CLI) is as follows:
C:\Users\%user%\source\repos\Wisniowy.FSharpUtils\Wisniowy.FSharpUtils.DatabaseAccess\Library.fs(12,16): error FS3033: The type provider 'FSharp.Data.Sql.SqlTypeProvider' reported an error: Could not create the connection, most likely this means that the connectionString is wrong. See error from Npgsql to troubleshoot: Could not load file or assemb
ly 'Microsoft.Extensions.Logging.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified. [C:\Users\%user%\source\repos\Wisniowy.FSharpUtils\Wisniowy.FSharpUtils.DatabaseAccess\Wisniowy.FSharpUtils.DatabaseAccess.fsproj]
C:\Users\%user%\source\repos\Wisniowy.FSharpUtils\Wisniowy.FSharpUtils.DatabaseAccess\Library.fs(12,16): error FS3033: The type provider 'FSharp.Data.Sql.SqlTypeProvider' reported an error: Could not create the connection, most likely this means that the connectionString is wrong. See error from Npgsql to troubleshoot: Could not load file or assemb
ly 'Microsoft.Extensions.Logging.Abstractions, Version=6.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. The system cannot find the file specified. [C:\Users\%user%\source\repos\Wisniowy.FSharpUtils\Wisniowy.FSharpUtils.DatabaseAccess\Wisniowy.FSharpUtils.DatabaseAccess.fsproj]
So I focus mostly on the first line: "The type provider 'FSharp.Data.Sql.SqlTypeProvider' reported an error: Microsoft.Data.SqlClient is not supported on this platform."
I have Microsoft.Data.SqlClient installed in this project, all my nuget packages are:
SQLProvider - v.1.3.7
Npgsql - v.7.0.2
Microsoft.Data.SqlClient - v.5.1.0
To Reproduce
Steps to reproduce the behavior:
Copy the code provided above
Make sure you have an instance of PostgreSQL (or a docker container)
Try to run the code
Expected behavior
Successful connection with the db and a successful sample read done..
Screenshots
The error displayed when I hover over the code sample:
and when I build the solution with ctrl+shift+B (same error)
The dll files added to the "resolution path" location:
I added Npgsql.dll along with two other dlls according to some suggestion I had found on stack overflow (they are the external dependencies that Npgsql.dll has and that it needs)
Desktop (please complete the following information):
OS: Windows 10
Additional context
The text was updated successfully, but these errors were encountered:
Describe the bug
I am trying to establish a connection with PostgreSQL. Following this docs site: https://fsprojects.github.io/SQLProvider//core/postgresql.html I have copied Npgsql.dll in the chosen location and provided a path to this location as a ResolutionPath argument.
I have this code to achieve the connection:
`
module Postgresql =
open FSharp.Data.Sql
`
The error that I get when trying to build the project (via CLI) is as follows:
So I focus mostly on the first line: "The type provider 'FSharp.Data.Sql.SqlTypeProvider' reported an error: Microsoft.Data.SqlClient is not supported on this platform."
I have Microsoft.Data.SqlClient installed in this project, all my nuget packages are:
SQLProvider - v.1.3.7
Npgsql - v.7.0.2
Microsoft.Data.SqlClient - v.5.1.0
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Successful connection with the db and a successful sample read done..
Screenshots
![image](https://user-images.githubusercontent.com/28803588/228365826-453e8258-f716-4d67-8a8f-9264cf8a8222.png)
![image](https://user-images.githubusercontent.com/28803588/228366351-b2388d66-77e4-47d9-9f18-1596e2c3a634.png)
![image](https://user-images.githubusercontent.com/28803588/228368795-a4d5ed2d-8e22-41ad-b5ab-2be273e72c9e.png)
The error displayed when I hover over the code sample:
and when I build the solution with ctrl+shift+B (same error)
The dll files added to the "resolution path" location:
I added Npgsql.dll along with two other dlls according to some suggestion I had found on stack overflow (they are the external dependencies that Npgsql.dll has and that it needs)
Desktop (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: