Skip to content

SMO 181.15.0 breaks with Microsoft.Data.SqlClient 7.0.0 #219

@pregress

Description

@pregress

After upgrading to Microsoft.Data.SqlClient 7.0.0 and installing the new <PackageReference Include="Microsoft.Data.SqlClient.Extensions.Azure" Version="1.0.0" /> to authenticate against Azure SQL with managed identity.

We get the following runtime error

Error Message: System.TypeLoadException : Could not load type 'Microsoft.Data.SqlClient.SqlAuthenticationMethod' from as
sembly 'Microsoft.Data.SqlClient, Version=7.0.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5'.
Stack Trace:
at Microsoft.SqlServer.Management.Common.ConnectionSettings.InitFromSqlConnection(SqlConnection sc)
at Microsoft.SqlServer.Management.Common.ConnectionSettings.InitFromSqlConnection(SqlConnection sc)
at Microsoft.SqlServer.Management.Common.ConnectionManager..ctor(SqlConnection sqlConnectionObject, IRenewableToken ac
cessToken)
at Microsoft.SqlServer.Management.Common.ServerConnection..ctor(SqlConnection sqlConnection, IRenewableToken accessTok
en)
at Microsoft.SqlServer.Management.Common.ServerConnection..ctor(SqlConnection sqlConnection)

On the following line. Where we use a Azure AD connection string.
var smoServer = new Server(new ServerConnection(sqlConnection));

Related: https://github.com/dotnet/SqlClient/releases/tag/v7.0.0

On .net 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