Skip to content

Unclear exception in sqlite type provider in .net core 3.1 project #684

@BlooDCrescent

Description

@BlooDCrescent

Describe the bug
In a netcoreapp3.1 project creating a SqlTypeProvider with provider type SQLITE yields a vague exception

To Reproduce
Steps to reproduce the behavior:

  1. Create a new console app project, target .net core 3.1
  2. Create an empty database
  3. Install SQLProvider and Microsoft.Data.Sqlite nuget packages
  4. Type the following code in Program.fs file:
open FSharp.Data.Sql

[<Literal>]
let connectionString =
            "Data Source=" + 
            __SOURCE_DIRECTORY__ + @"\BarDb.db;" + 
            "Version=3;foreign keys=true"

type sql = SqlDataProvider<
                        Common.DatabaseProviderTypes.SQLITE,
                        connectionString,
                        SQLiteLibrary = Common.SQLiteLibrary.MicrosoftDataSqlite,
                        CaseSensitivityChange = Common.CaseSensitivityChange.ORIGINAL>
  1. Build a project
  2. See error

Expected behavior
Code compiles without errors

Actual behavior
An error is displayed:

Error FS3033 The type provider 'FSharp.Data.Sql.SqlTypeProvider' reported an error: Exception has been thrown by the target of an invocation.

Desktop

  • OS: Windows 10 version 1909
  • .NET SDK: .net core 3.1.301

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