user2432627
user2432627

Reputation: 157

PCL project not compiling after updating all the installed NuGet portable libraries

Everything was working fine in my Portable-Class-Library project until I updated all the installed portable libraries. It has stopped compiling. Throws the following errors for the nuget libraries installed.

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "System.Threading.Tasks" could not be resolved because it has an indirect dependency on the framework assembly "System.Runtime, Version=2.6.3.0, Culture=neutral, PublicKeyToken=b03f5f7fd11d50a3a" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile104". To resolve this problem, either remove the reference "System.Threading.Tasks" or retarget your application to a framework version which contains "System.Runtime, Version=2.6.3.0, Culture=neutral, PublicKeyToken=b03f5f7fd11d50a3a".

1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "System.Net.Http.Extensions" could not be resolved because it has an indirect dependency on the framework assembly "System.Runtime, Version=2.6.3.0, Culture=neutral, PublicKeyToken=b03f5f7fd11d50a3a" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile104". To resolve this problem, either remove the reference "System.Net.Http.Extensions" or retarget your application to a framework version which contains "System.Runtime, Version=2.6.3.0, Culture=neutral, PublicKeyToken=b03f5f7fd11d50a3a".

1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "Microsoft.Threading.Tasks.Extensions" could not be resolved because it has an indirect dependency on the framework assembly "System.Runtime, Version=2.6.3.0, Culture=neutral, PublicKeyToken=b03f5f7fd11d50a3a" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile104". To resolve this problem, either remove the reference "Microsoft.Threading.Tasks.Extensions" or retarget your application to a framework version which contains "System.Runtime, Version=2.6.3.0, Culture=neutral, PublicKeyToken=b03f5f7fd11d50a3a".

1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "PCLStorage" could not be resolved because it has an indirect dependency on the framework assembly "System.Runtime, Version=2.6.3.0, Culture=neutral, PublicKeyToken=b03f5f7fd11d50a3a" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile104". To resolve this problem, either remove the reference "PCLStorage" or retarget your application to a framework version which contains "System.Runtime, Version=2.6.3.0, Culture=neutral, PublicKeyToken=b03f5f7fd11d50a3a".

1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "Microsoft.Threading.Tasks" could not be resolved because it has an indirect dependency on the framework assembly "System.Runtime, Version=2.6.3.0, Culture=neutral, PublicKeyToken=b03f5f7fd11d50a3a" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile104". To resolve this problem, either remove the reference "Microsoft.Threading.Tasks" or retarget your application to a framework version which contains "System.Runtime, Version=2.6.3.0, Culture=neutral, PublicKeyToken=b03f5f7fd11d50a3a".

1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "System.Net.Http" could not be resolved because it has an indirect dependency on the framework assembly "System.Runtime, Version=2.6.3.0, Culture=neutral, PublicKeyToken=b03f5f7fd11d50a3a" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile104". To resolve this problem, either remove the reference "System.Net.Http" or retarget your application to a framework version which contains "System.Runtime, Version=2.6.3.0, Culture=neutral, PublicKeyToken=b03f5f7fd11d50a3a".

1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1605,5): warning MSB3268: The primary reference "PCLStorage.Abstractions" could not be resolved because it has an indirect dependency on the framework assembly "System.Runtime, Version=2.6.3.0, Culture=neutral, PublicKeyToken=b03f5f7fd11d50a3a" which could not be resolved in the currently targeted framework. ".NETPortable,Version=v4.0,Profile=Profile104". To resolve this problem, either remove the reference "PCLStorage.Abstractions" or retarget your application to a framework version which contains "System.Runtime, Version=2.6.3.0, Culture=neutral, PublicKeyToken=b03f5f7fd11d50a3a".

How to point it to System.Runtime version 2.6.3.0?

Upvotes: 3

Views: 1986

Answers (2)

user2432627
user2432627

Reputation: 157

Fixed the problem.

The PCL project's app.config was pointing to 2.6.3.0 version of System.Runtime. I changed it to point to 1.5.11.0, the previous one, and it compiled fine.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
   //   <!--  <bindingRedirect oldVersion="0.0.0.0-2.6.3.0" newVersion="2.6.3.0" /> -->
        <bindingRedirect oldVersion="0.0.0.0-1.5.11.0" newVersion="1.5.11.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

Upvotes: 2

Jon Douglas
Jon Douglas

Reputation: 13176

Make sure your PCL version supports the dependencies you need. Here is a spreadsheet regarding the current support courtesy of CheeseBaron.

https://docs.google.com/spreadsheet/pub?key=0AgHEgqqaasTkdDVMQWNURUNhSUdlZzV0Z2p3djlLQ3c&single=true&gid=3&output=html

Note - Because this is still in it's infancy of supporting certain libraries, you'll have to find the right one that works for your project.

Upvotes: 1

Related Questions