Why can't my PCL use System.Runtime?

I have a PCL that is designed for the following platforms:

  • .NET Framework 4.5
  • Windows 8
  • Windows Phone 8.1

I need to add a link to System.Runtimebecause I want to use another package that depends on it. From what I see, version 4.0.0 seems to include the target platforms mentioned above. However, when I try to install it through NuGet, I get this stack trace:

PM> Install-Package System.Runtime -Version 4.0.0
# ...
Install failed. Rolling back...
Package 'System.Runtime 4.0.0' does not exist in project 'PclDummy'
Package 'System.Runtime 4.0.0' does not exist in folder 'C:\Users\James\Documents\Visual Studio 2015\Projects\PclDummy\packages'
Install-Package : Could not install package 'System.Runtime 4.0.0'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile111', 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.

Why does this happen if it System.Runtimesupports all the platforms my PCL runs on?

0
source share
2 answers

".NETPortable, Version = v4.5, Profile = Profile111"

. PCL, . System.Runtime, C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.5\Profile\Profile111 . , .

", Nuget CoreCLR. , - . , Profile111, ASP.NET Core 5.0. , , , , . , , Nuget. , .

.

+1

, System.Runtime 4.5.

:

C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile111

.

0

Source: https://habr.com/ru/post/1609389/


All Articles