Search code examples
xamarin.iosnugetnuget-packagexamarin-studio

I can't install "System.Threading.Thread 4.0.0" in Xamarin Studio


I install a NuGet package of sqlite-net and this package create a class in the main project, SQLite.cs and this class use the "System.Threading.Thread" and I try to install the "System.Threading.Thread 4.0.0" from NuGet but i have an error:

Adding System.Threading.Thread... Adding 'System.Threading.Thread 4.0.0' to AyVoy. Could not install package 'System.Threading.Thread 4.0.0'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarintvos10+xamarinwatchos10+xamarinios10', 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.

Any idea of how I can install this package?

Thank you.


Solution

  • You are trying to install System.Threading.Thread 4.0.0 which supports .NET Standard 1.3 into a Portable Class Library (PCL) project that targets Profile 78. This is not supported. None of the portable class library projects that use a packages.config file support .NET Standard 1.3.

    The PCL profile to .NET Standard mapping is documented:

    • Profile7 -> .NET Standard 1.1
    • Profile31 -> .NET Standard 1.0
    • Profile32 -> .NET Standard 1.2
    • Profile44 -> .NET Standard 1.2
    • Profile49 -> .NET Standard 1.0
    • Profile78 -> .NET Standard 1.0
    • Profile84 -> .NET Standard 1.0
    • Profile111 -> .NET Standard 1.1
    • Profile151 -> .NET Standard 1.2
    • Profile157 -> .NET Standard 1.0
    • Profile259 -> .NET Standard 1.0

    Whilst .NET Standard is supported with recent versions of Xamarin Studio 6.0.2 and Mono 4.4.2 you cannot install System.Threading.Thread into a PCL project using the above profiles.

    You can install the System.Threading.Thread NuGet package into a Xamarin.iOS or a Xamarin.Android project with the latest versions of Xamarin Studio and Mono.