Skip to content

The type provider 'FSharp.Data.Sql.SqlTypeProvider' reported an error: System.Data.SqlClient is not supported on this platform #771

Closed
@houdelou

Description

@houdelou

Describe the bug
Cannot execute a query in a .net 6 project.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new .NET 6 web F# web application in Visual Studio.
  2. Add a script .fsx file
  3. Install SQLProvider Nuget 1.3.1.
  4. Add a reference #r to the netstandard2.0 dll.
  5. Add a reference to localDB.
  6. Do a basic query.
  7. Select All and right-click "Execute In Interactive"
  8. The type provider 'FSharp.Data.Sql.SqlTypeProvider' reported an error: System.Data.SqlClient is not supported on this platform

Expected behavior
Expect to see the query result in the output window.

Desktop (please complete the following information):

  • OS: Windows 10

Additional context
Is .NET 6 supported ?

#r@"~\.nuget\packages\sqlprovider\1.3.1\lib\netstandard2.0\FSharp.Data.SqlProvider.dll"

open FSharp.Data.Sql

let [<Literal>] connectionString = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=~\source\repos\db.mdf;Integrated Security=True;Connect Timeout=30"

type sql = SqlDataProvider<
    ConnectionString = connectionString,
    DatabaseVendor = Common.DatabaseProviderTypes.MSSQLSERVER,
    IndividualsAmount = 1000,
    UseOptionTypes = FSharp.Data.Sql.Common.NullableColumnType.OPTION>


let ctx = sql.GetDataContext()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions