question

MatteoPozzato-2066 avatar image
0 Votes"
MatteoPozzato-2066 asked RobCaplan edited

Xamarin Android - Sqlclient is not supported on this platform

Hi,
I'm developing a XF cross app.
I'm using some projects that are part of our company base's frameworks that run also in some our web application on .net standard 2.0.

Inside these frameworks there are some function that done the queries on a MSSQL DB and use the SqlCommand.

If I compile the frameworks's DLL and use them in my XF application all works fine, but if I add the project's framework to the XF solution an error is trigger only on the Android project when the app try to perform the first query.

As I told, if I use only the compiled DLL all works fine.
For the iOS project works also with the project's frameworks.

The frameworks use the NuGet package System.Data.SqlClient, and the mobile app Microsoft.Data.Sqlite.Core.

We have tried both with Microsoft.Data.SqlClient and with System.Data.SqlClient.
For System.Data I have tried with multiple versions:

-4.8

-4.7

-4.6

-4.5

We need to have the project's frameworks inside the XF solution to debug them.

How can we solve this?

86309-screenshot-2021-04-09-at-171010.png


dotnet-xamarin
· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

but if I add the project's framework to the XF solution an error is trigger only on the Android project when the app try to perform the first query.

Hi @MatteoPozzato-2066 , how did you add the project's framework to the XF solution? Would you please help share your steps?

0 Votes 0 ·

Sorry, my fault.
The FRMK projects are in .net Standard 2.0.
86757-screenshot-2021-04-12-at-102557.png


0 Votes 0 ·

We do not recommend integrating SQLClient into Xamarin. You can check the issue: https://github.com/dotnet/SqlClient/issues/831 .

0 Votes 0 ·

0 Answers