Skip to content

Missing Type Microsoft.Data.SqlClient.SqlAuthenticationMethod - .NET Framework 4.8 #4064

@rozeboosje

Description

@rozeboosje

Describe the bug

Code snippet in VB.NET

`'

Dim sConnectionString As String

sConnectionString = "Server=[server name here].database.windows.net;Database=[database name here];Application Name=[something];uid=[a QL username];pwd=[a SQL password];TrustServerCertificate=True;"

Dim oCONSQL As Microsoft.Data.SqlClient.SqlConnection = Nothing  

oCONSQL = New Microsoft.Data.SqlClient.SqlConnection(sConnectionString)  

oCONSQL.Open()  

If oCONSQL.State = ConnectionState.Open Then  

    Dim oCONServerConnection As Microsoft.SqlServer.Management.Common.ServerConnection = Nothing  

    oCONServerConnection = New Microsoft.SqlServer.Management.Common.ServerConnection(sqlConnection:=oCONSQL)

End If`
Exception message: Could not load type 'Microsoft.Data.SqlClient.SqlAuthenticationMethod' from assembly 'Microsoft.Data.SqlClient, Version=7.0.0.0, Culture=neutral, PublicKeyToken=23ec7fc2d6eaa4a5'.
Stack trace:

To reproduce

The above may suffice to reproduce the issue?

Expected behavior

A clear and concise description of what you expected to happen.

Further technical details

Microsoft.Data.SqlClient version: 7.0.0
.NET target: (e.g. .NET Framework 4.8)
SQL Server version: (e.g. SQL Server 2022 - Azure SQL)
Operating system: n/a

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    External 🔗Issue is in an external component

    Type

    Projects

    Status

    In review

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions