Error Changing Profiles in PCL

I am attempting to change my PCL Profile from158 to 259 so I can add the Xamarin.Insights package. As soon as I change the profile, I get compiler errors that say an assembly with the same identity has already been loaded. It names three assemblies: System.IO, System.Runtime, and System.Threading.Tasks. I found this post http://blogs.msdn.com/b/dotnet/p/pcl_known_issues.aspx which recommends deleting those references from the platform specific projects. But, those references aren't in my platform specific projects. I have tried removing them from the PCL but then it can't find things like System.Type.

I have the following nuget packages referenced in the PCL:
Microsoft Async
Microsoft BCL Build Components
Microsoft BCL Portability Pack
Microsoft HTTP Client Libraries

I also have a bunch of MvvmCross packages referenced.

Any idea what would cause these errors?

Posts

  • mattwardmattward GBMember Xamurai

    If you are using an old version of the BCL and HTTP NuGet packages I would try updating them. Older versions had problems working with Xamarin as far as I am aware.

  • MarkEntnerMarkEntner USMember, University

    Thanks @mattward‌ . I have version 1.9 of the BCL projects, I think that is the latest? Nuget isn't showing that there are any pending updates.

  • mattwardmattward GBMember Xamurai

    If you are using the latest NuGet packages then it is probably worth posting the compiler errors you are getting.

  • MarkEntnerMarkEntner USMember, University

    Here are the compiler errors I'm getting. The warnings look like the ones in the post at http://blogs.msdn.com/b/dotnet/p/pcl_known_issues.aspx. But deleting the references doesn't fix it.

    3>C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1696,5): warning MSB3277: Found conflicts between different versions of the same dependent assembly that could not be resolved. These reference conflicts are listed in the build log when log verbosity is set to detailed.

    3>c:\Projects\Maximo\MaxRaw\packages\Microsoft.Bcl.1.1.9\lib\portable-net40+sl5+win8+wp8+wpa81\System.IO.dll : error CS1703: An assembly with the same identity 'System.IO, Version=1.5.11.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' has already been imported. Try removing one of the duplicate references.

    3>c:\Projects\Maximo\MaxRaw\packages\Microsoft.Bcl.1.1.9\lib\portable-net40+sl5+win8+wp8+wpa81\System.Runtime.dll : error CS1703: An assembly with the same identity 'System.Runtime, Version=2.6.9.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' has already been imported. Try removing one of the duplicate references.

    3>c:\Projects\Maximo\MaxRaw\packages\Microsoft.Bcl.1.1.9\lib\portable-net40+sl5+win8+wp8+wpa81\System.Threading.Tasks.dll : error CS1703: An assembly with the same identity 'System.Threading.Tasks, Version=2.6.9.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' has already been imported. Try removing one of the duplicate references.

  • MarkEntnerMarkEntner USMember, University

    I found these redirect entries in the app.config file. Since I don't believe in coincidences, I'm guessing these entries are related to the issue some how.

    <dependentAssembly> <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-2.6.9.0" newVersion="2.6.9.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-2.6.9.0" newVersion="2.6.9.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="System.IO" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-2.6.8.0" newVersion="2.6.8.0" /> </dependentAssembly>

  • MarkEntnerMarkEntner USMember, University

    I think I have this sorted out. I needed to uninstall the bcl and related packages and re-install them. That did the trick. Of course, now I don't have access to a Timer or Reflection methods. But I think I can sort out those issues.

  • JonDouglasJonDouglas USXamarin Team, University, Developer Group Leader Xamurai
    edited January 2015
  • codenutzcodenutz GBMember
    edited March 2015

    I don't understand how that stack overflow question answers the problem - maybe I'm being stupid!?!

    Can you explain what the resolution is?

    I've tried uninstalling -> reinstalling the bcl packages but that hasn't helped

    Forget that post - I think I was missing the update to the latest version part

Sign In or Register to comment.