2
votes

I am writing a crossplatform (iOS and android) Xamarin app and I need a sql connection to my database. I found out that I need System.Data.SqlClient to achieve this. But when I try to add System.Data.SqlClient to my core project I get:

Could not install package 'System.Data.SqlClient 4.4.0'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile259', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

I get that apparently this .NETPortable version is compatible, but what is the solution to this? There must be a way to access a SQL database. Also I found that other posts asked to add System.Data first, but this package doesn't even show up in nuget.

1

1 Answers

2
votes

In case that you change your pcl project into .NET Standard you should be able to install this nuget package.

Follow this awesome snack pack!

In Visual Studio Preview there is template to create xamarin project using .netstandard. I can confirm that it works.