Introduction
Over the last month or so, I have used an Apple MacBook Pro M3 Max as my daily driver. As I develop using Visual Studio rather than Code, I run Windows 11 Arm on the Mac using Parallels. For the most part, it just works. However, yesterday, I found that the SQL Server Object Explorer in Visual Studio wouldn’t work, and each time I tried to connect to a SQL database, I received a Microsoft.Data.SqlClient.TdsParser exception.
The Microsoft.Data.SqlClient.TdsParser exception
After digging in a little, I was getting an unable to find ‘Microsoft.Data.SqlClient.SNI.arm64.dll’ error: –
This is a known error that Microsoft is working on, but that didn’t help me. So, I looked around for a solution and found the answer here: – Visual Studio 2022 (ARM) Connection to SQL Server on another Machine resulted in Microsoft.Data.SqlClient.TdsParser exception – Developer Community.
The fix
The DLL in question can be found in a Nuget package called Microsoft.Data.SqlClient.SNI package.
I downloaded that from the Nuget site and extract the DLL using a great tool called Nuget Package Explorer that can be downloaded from the Microsoft Store.
I opened the nuget package in that and found the required DLL and saved it to disk like this: –
I then copied the file to my Visual Studio SQL DB folder at: –
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Microsoft\SQLDB\DAC
Depending on your version of Visual Studio and Windows this might be different for you.
I then tried to open the SQL Object Explorer but it failed with the same error. Fortunately, I just restarted Visual Studio and then it worked perfectly.
Conclusion
Lots of problems can be fixed by installing the latest version of the standard installer, but there are times when you have to find a workaround. In this case, the workaround was an easy fix, assuming you are happy using additional tools to download and extract files from packages and installers.