0

I'm upgrading a Blazor Server app (.NET 5) to WebAssembly and .NET 8, and moving it from on-site to Azure. In the process of upgrading it, I started getting the error :

System/Microsoft.Data.SqlClient is not supported on this platform (I tried both).

Neither came installed with the application when it was first built, and I used the Package Manager Console with:

install-package System.Data.SqlClient (Installed 4.8.5)

and
install-package Microsoft.Data.SqlClient (Installed 5.1.1)

And trying to do the same in a .NET 7 project didn't fix the issue either.

Any help would be greatly appreciated.

jnelson
  • 41
  • 1
  • 10
  • 2
    SQL Server clients build on top of native C APIs to communicate with the server, which won't be available to WebAssembly. AFAIK, you'll need a server-side component to do your SQL queries as: 1) it's not supported in WebAssembly; 2) there's no secure way to store credentials to authenticate with SQL Server in the browser. – Martin Costello Aug 22 '23 at 17:02
  • @MartinCostello I was digging around and found this: https://github.com/dotnet/SqlClient/issues/599 Which pretty much confirms exactly what you said, in detail. Looks like I have to convert the DAL into an API then. – jnelson Aug 22 '23 at 17:29

0 Answers0