Skip to content

SQLProvider + PostgreSql works with Rider and VSCode but not visual studio 2022 #792

Open
@kgday

Description

@kgday

Describe the bug
SqlProvider + postgresql with Rider but not Visual Studio 2022

Set up the provider as per usual using rider

    [<Literal>]
    let private designTimeDataConnStr = @"Server=127.0.0.1;Database=WGDDev;Username=WGDApp;Password=<password>"
    
    [<Literal>]
    let private resolutionPath = __SOURCE_DIRECTORY__ + @"\DBLib"
    
    type Sql = SqlDataProvider<
        ConnectionString = designTimeDataConnStr,
        DatabaseVendor = DatabaseProviderTypes.POSTGRESQL,
        ResolutionPath = resolutionPath,
        UseOptionTypes = NullableColumnType.OPTION

The picture below shows the files in the DBLib directory:

image

Expected behavior
For SqlProvider to work equally as well in Visual Studio as in Rider

Desktop (please complete the following information):

  • OS: Win 11
  • Visual Studio Community version 17.6.0

The error message in Visual Studio is

The type provider 'FSharp.Data.Sql.SqlTypeProvider' reported an error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
Details: 
Could not load type 'System.IAsyncDisposable' from assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
Could not load type 'System.Threading.Tasks.Sources.IValueTaskSource`1' from assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
Could not load type 'System.Collections.Generic.IAsyncEnumerable`1' from assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
Could not load type 'System.Collections.Generic.IAsyncEnumerator`1' from assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
Could not load type 'System.ReadOnlyMemory`1' from assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
Could not load type 'System.Runtime.CompilerServices.ValueTaskAwaiter`1' from assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
Could not load type 'System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder' from assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
Could not load type 'System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder`1' from assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
Could not load type 'System.Runtime.CompilerServices.ValueTaskAwaiter' from assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
Could not load type 'System.Memory`1' from assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
Current execution platform: .NETFramework,Version=v4.7.2	WGD.DB	D:\Development\Projects\Upwork\WGD\Src\WGD.DB\DataConnection.fs	28	Active

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