MSSQL connection in Visual Studio Mac->(Socket Exception)

moialbla 5 Reputation points
2025-05-03T20:21:38.7133333+00:00

HI Community!

I am facing the following problem and it is driving me crazy. I was creating a SQL Server in Azure, and I was trying to connect via Visual Studio Code, but using the exactly same configuration n Mac I am getting this error

User's image

System.Net.Sockets.SocketException (22): Invalid argument at System.Net.Sockets.Socket.UpdateStatusAfterSocketOptionErrorAndThrowException(SocketError error, String callerName) at Microsoft.Data.SqlClient.SNI.SNITCPHandle.Receive(SNIPacket& packet, Int32 timeoutInMilliseconds) at Microsoft.Data.SqlClient.TdsParserStateObject.ReadSniSyncOverAsync() at Microsoft.Data.SqlClient.TdsParser.ConsumePreLoginHandshake(SqlConnectionEncryptOption encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean& marsCapable, Boolean& fedAuthRequired, Boolean tlsFirst, String serverCert) at Microsoft.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnectionString connectionOptions, Boolean withFailover) at

Mac Specifications

Hardware Overview:

  Model Name: MacBook Pro

  Model Identifier: MacBookPro18,1

  Chip: Apple M1 Pro

  Total Number of Cores: 10 (8 performance and 2 efficiency)

  Memory: 16 GB

  System Firmware Version: 11881.101.1

  OS Loader Version: 11881.101.1

Software:

System Software Overview:

  System Version: macOS 15.4.1 (24E263)

  Kernel Version: Darwin 24.4.0

User's image

However, if I am using my Windows laptop and having the same connection String I could connect it and create tables.. my question is.. WHY? I've been googling and I found this issue https://github.com/dotnet/runtime/issues/81378 but not answer :(. :(

Anybody can help me?

Thanks!

SQL Server Database Engine
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.