FsAutoComplete icon indicating copy to clipboard operation
FsAutoComplete copied to clipboard

Intellisense for SQLProvider broken when both .NETCore 2.1 SDk and .NETCore 3.1 SDK installed

Open teyc opened this issue 4 years ago • 0 comments

I’ve been playing around with SQLProvider , under VSCode and PostGres, and I noticed an interesting behavior.

When only .NET Core 3.1 SDK installed, syntax highlighting worked fine. But when I install both 3.1 SDK and 2.1 SDK, I get the following message:

The type provider 'FSharp.Data.Sql.SqlTypeProvider' reported an error:

Unable to load one or more of the requested types.
Could not load type 'System.IAsyncDisposable' from 
assembly 'System.Runtime, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.

And when I have only 2.1 SDK installed, the project highlights properly, but dotnet build fails.

My relevant VScode settings are:

  "FSharp.fsacRuntime": "netcore",
  "FSharp.fsiFilePath": "/usr/local/share/dotnet/dotnet",
  "FSharp.fsiExtraParameters": [
        "fsi"
    ],
  "FSharp.useSdkScripts": true

I’ve observed this on both Windows and OS X.

I noted that AsyncDisposable is part of .NETStandard 2.1 (which is introduced with .NET Core 3.0), and the FSAC is probably loading .NETStandard 2.0?

I've also added a reference to Microsoft.Bcl.AsyncInterfaces in addition to targetting netcoreapp3.1 in the hope that the IDE will pick up the types, but to no avail.

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.1</TargetFramework>
  </PropertyGroup>
  <ItemGroup>
    <PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="1.1.0" />
  </ItemGroup>

Bug must be associated with this: https://github.com/fsharp/FsAutoComplete/issues/465

Gist: https://gist.github.com/teyc/6cfd974277035b81aee037d12aff12a8

teyc avatar Mar 14 '20 08:03 teyc