Skip to content

FSX file in Visual Studio attempts to load .NET 7 assemblies #15604

@kant2002

Description

@kant2002

Visual Studio cannot confuses NET FW and NET probably. When I have FSX opened in Ionide, then type provider works fine.

Repro steps

  1. Create test.fsx with following content
#r "nuget: Npgsql"
#r "nuget: SQLProvider"
open FSharp.Data.Sql

let [<Literal>] connectionString = "Host=localhost;Port=5432;Database=backend;Username=konaev;Password="

// create a type alias with the connection string and database vendor settings
type sql = SqlDataProvider<Common.DatabaseProviderTypes.POSTGRESQL, connectionString>
  1. Open test.fsx in visual studio.

Expected behavior

I would like to have no errors in Visual Studio.

Actual behavior

image

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 file or assembly 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Could not load file or assembly 'System.Data.Common, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Could not load file or assembly 'System.Diagnostics.Tracing, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Could not load file or assembly 'System.Threading, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Could not load file or assembly 'System.ComponentModel.TypeConverter, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Current execution platform: .NETFramework,Version=v4.7.2

Known workarounds

Provide a description of any known workarounds.

Related information

Provide any related information (optional):

  • Operating system
  • .NET Runtime kind (.NET Core, .NET Framework, Mono)
  • Editing Tools (e.g. Visual Studio Version, Visual Studio) Version 17.7.0 Preview 2.0

Metadata

Metadata

Assignees

Type

No fields configured for Bug.

Projects

Status

New

Relationships

None yet

Development

No branches or pull requests

Issue actions