Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kgday opened this issue May 22, 2023 · 0 comments

Comments

@kgday
Copy link

kgday commented May 22, 2023

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
@kgday kgday changed the title SQLProvider + PostgreSql works with Rider but not visual studio 2022 SQLProvider + PostgreSql works with Rider and VSCode but not visual studio 2022 Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant