Skip to content

Type load fails - cannot locate 'Microsoft.SqlServer.Server.SqlDataRecord' #9

Description

@danpaul88

Describe the bug

Upon replacing System.Data.SqlClient with the latest preview of Microsoft.Data.SqlClient (version 1.0.19128.1-Preview) I get the following type load exception upon starting my .NET Framework 4.7 application;

ReflectionTypeLoadException
  Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

  LoaderExceptions (3x the same)
    Could not load type 'Microsoft.SqlServer.Server.SqlDataRecord' from assembly 'Microsoft.Data.SqlClient, Version=1.0.19128.1, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5'.

  Stack Track
     at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
     at System.Reflection.Assembly.GetTypes()

I've verified that Microsoft.Data.SqlClient.dll is present in the output folder of the build (and System.Data.SqlClient.dll is not present). I've run a dotnet clean and dotnet restore to try and fix it to no avail.

To reproduce

Upgrade a .NET framework 4.7 application using System.Data.SqlClient to Microsoft.Data.SqlClient and run it

Expected behavior

It would run successfully

Further technical details

Microsoft.Data.SqlClient version: 1.0.19128.1-Preview
.NET target: net47
SQL Server version: not relevant to issue (not getting far enough to try connecting)
Operating system: Windows 10

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