Compile error in WinPhone after updating to Xamarin Forms 1.3.1.0 - 'Cannot resolve dependency'

UdaraAlwisUdaraAlwis ✭✭LKMember ✭✭

Hi everyone,

I just updated my project to Xamarin Forms 1.3.1.0 update through nuget in my Visual Studio, but unfortunately after I compiled the Windows Phone project its giving this compilation error, unlike in Android and iOS !

Cannot resolve dependency to assembly 'Xamarin.Forms.Core, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.

i tried cleaning and rebuilding and restarting Visual Studio, but nothing is working :( ! This only happens in Windows Phone project, but Android and iOS are working fine. Did any encounter with this issue? if so what is the solution for this ? :(

Thanks in advance. :)

Best Answers

  • ThomasHagstrmThomasHagstrm ✭✭ SE ✭✭
    Accepted Answer

    I got this by updating Xamarin.Forms and Xamarin Toasts nuget packages. Uninstalling the Toasts plugin resolved my issue.

    Cannot resolve dependency to assembly Xamarin.Forms.Core, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null because it has not been preloaded

  • ThomasHagstrmThomasHagstrm ✭✭ SE ✭✭
    Accepted Answer

    Yeah, @UdaraAlwis‌, most plugins are now incompatible. I really home Xamarin knows this

Answers

  • PaulDistonPaulDiston ✭✭✭✭ USUniversity ✭✭✭✭

    Hi,

    Have you tried removing the Xamarin.Forms references from your Windows Phone projects and adding them again?

    Thanks

    Paul Diston

  • UdaraAlwisUdaraAlwis ✭✭ LKMember ✭✭

    Hi @PaulDiston‌ , Yes I tried that as well :( but still no luck.

    btw Thanks for the reply :)

  • UdaraAlwisUdaraAlwis ✭✭ LKMember ✭✭

    [UPDATE]

    I created a dummy project and tried upgrading it to XF 1.3.1.0 update, and I got the same error again in WinPhone ! Therefore it seems like a bug in the new update, hope they would release a fix soon !

  • JozsefKiralyJozsefKiraly USMember

    Do you have the Xamarin.Forms.Core library as reference? Just asking, because for me, the upgrade went fine without any issue.

  • UdaraAlwisUdaraAlwis ✭✭ LKMember ✭✭
    edited January 2015

    @JozsefKiraly‌ Yes I do, I have all the three references Xamarin.Forms.Core, Xamarin.Forms.Platform.WP8 and Xamarin.Forms.Xaml from the nuget folder in my WinPhone project.

    "\Xamarin.Forms.1.3.0.6292\lib\WP80\"

    Btw, good to hear that yours' worked out without an issue. I will focus further for any local configuration issue. Thanks for the info. :)

  • RobertStubbsRobertStubbs USMember

    make sure if you are using visual studio 2013 that you are on update 4, i had issues with all my project migrations because i was on update 2...after updating i reset my branch and tried migrating again and it worked fine

  • JozsefKiralyJozsefKiraly USMember

    It might be because I manually created and updated the WinPhone projects (my computer has no Hyper-V, and thus, the WP80 simulators won't install, and thus, Xamarin for VS2013 does not recognize it as a compatible project).

  • ThomasHagstrmThomasHagstrm ✭✭ SEMember ✭✭
    Accepted Answer

    I got this by updating Xamarin.Forms and Xamarin Toasts nuget packages. Uninstalling the Toasts plugin resolved my issue.

    Cannot resolve dependency to assembly Xamarin.Forms.Core, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null because it has not been preloaded

  • UdaraAlwisUdaraAlwis ✭✭ LKMember ✭✭

    Hi @RobertStubbs , yes I have the VS2013 Update 4 :) So I guess it shouldn't be a problem with my Visual Studio..

    @JozsefKiraly Yeah I did the same, by creating a Windows Phone project manually.

    @ThomasHagstrm Ah yes ! I'm also using the Xamarin Toasts plugin, could be a problem with that then. I will try removing it and get back to you. :)

    Thanks for the information everyone.

  • JozsefKiralyJozsefKiraly USMember

    Ah yes, indeed. If you do not update the dependent references (any Xamarin.Forms Plugin), they'll try to reference the old Xamarin.Forms.Core - ran into this with another plugin from NuGet.

    VS seriously needs as deep NuGet integration as Xamarin Studio has...

  • UdaraAlwisUdaraAlwis ✭✭ LKMember ✭✭

    SOLVED !

    Thanks a lot @ThomasHagstrm ! it worked after i removed the Toasts.Forms.Plugin dlls. Well it looks like something is wrong with its dependencies, hope the developer of the extension will release an update after fixing this.

    Thanks everyone :)

  • ThomasHagstrmThomasHagstrm ✭✭ SEMember ✭✭
    Accepted Answer

    Yeah, @UdaraAlwis‌, most plugins are now incompatible. I really home Xamarin knows this

  • FB123FB123 ✭✭ CAMember ✭✭

    Please help as I'm running into a similar issue

    Cannot resolve dependency to assembly 'Xamarin.Forms.Platform.WP8, Version=1.3.0.0, Culture=neutral, PublicKeyToken=null' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.

    I've added the following packages:
    Xamarin.Forms (installed with the project)
    Xamarin.Forms.Maps
    JSON.net
    Xamarin.Forms.Labs - Core (prerelease)

    No code has been added and when I build the solution I get the cannot resolve dependency error...

  • ThomasHagstrmThomasHagstrm ✭✭ SEMember ✭✭

    Try removing one package at a time, @FrazzApps‌. As said, this version of Xamarin doesn't play well with other Xamarin packages. Doesn't matter if they're in use, it's enough that you have references to them.

  • UdaraAlwisUdaraAlwis ✭✭ LKMember ✭✭

    @FrazzApps

    Yes I do agree with @ThomasHagstrm‌ 's answer above, try carefully removing any custom plugins you have one by one and keep compiling each time. Once you find the conflict you may have to look for a substitution plugin which supports the new update.

    My issue was Toasts.Forms.Plugin plugin, so I had to remove it and use the Acr.XamForms.UserDialogs plugin instead as a substitute...

  • ThomasHagstrmThomasHagstrm ✭✭ SEMember ✭✭

    According to the Toasts creator, you can re-add them after you've gotten the project to build:

    https://github.com/EgorBo/Toasts.Forms.Plugin/issues/5#issuecomment-70482994

  • SabdullahSabdullah ✭✭ USMember ✭✭

    Upgrading to Xamarin.Forms 1.3.2 caused the same error for me, only with different version.

    Cannot resolve dependency to assembly 'Xamarin.Forms.Core, Version=1.3.1.0, Culture=neutral, PublicKeyToken=null' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.

    I am not using Toasts plugin.

  • SabdullahSabdullah ✭✭ USMember ✭✭

    Okay it seems some other plugins were causing this issue.

Sign In or Register to comment.