Reputation: 101
I've created a .net core class library which use ADO.net technology .
Used library :
System.Data.SqlClient version 4.4.3 from nuget
it works ok in .netcore console application . But, when i use it with Xamarin forms PCL it occurs the following error :
Severity Code Description Project File Line Suppression State Error CS1705 Assembly 'xxx' with identity 'xxx, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'System.Runtime, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' which has a higher version than referenced assembly 'System.Runtime' with identity 'System.Runtime, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
I tried to update System.Runtime library separately but result is the same .
How to fix this problem ?
Upvotes: 2
Views: 2923
Reputation: 1538
This can also happen if a NuGet package acting as a primary reference brings in lower versions of particular assemblies that are required in higher versions by a project referenced.
If you can't fix it with package consolidation, try adding the higher version as a primary reference to the project. Should the error mention a framework assembly, you'd need to add the appropriate metapackage (e.g. Microsoft.AspNetCore.App
) to the project as a primary reference.
Upvotes: 0
Reputation: 5250
The PCL projects rely on a selected API surface (the profile). System.Data.SqlClient
however, according to NuGet, does not support any PCL surface but only .NET Standard and various other SDKs. Change your shared library to a .NET Standard one, and the library should work.
Upvotes: 0
Reputation: 40
A couple of options/questions:
Upvotes: 0