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

  • Question

  • User92953 posted

    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. :)

    Wednesday, January 14, 2015 10:07 AM

Answers

  • User73114 posted

    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

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, January 15, 2015 8:16 PM
  • User73114 posted

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

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Monday, January 19, 2015 7:42 AM

All replies

  • User56293 posted

    Hi,

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

    Thanks

    Paul Diston

    Wednesday, January 14, 2015 10:14 AM
  • User92953 posted

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

    btw Thanks for the reply :)

    Wednesday, January 14, 2015 10:33 AM
  • User92953 posted

    [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 !

    Wednesday, January 14, 2015 10:42 AM
  • User97676 posted

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

    Wednesday, January 14, 2015 11:56 AM
  • User92953 posted

    @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. :)

    Wednesday, January 14, 2015 12:11 PM
  • User68610 posted

    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

    Wednesday, January 14, 2015 12:14 PM
  • User97676 posted

    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).

    Wednesday, January 14, 2015 2:31 PM
  • User73114 posted

    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

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, January 15, 2015 8:16 PM
  • User92953 posted

    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.

    Friday, January 16, 2015 4:27 AM
  • User97676 posted

    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...

    Friday, January 16, 2015 2:14 PM
  • User92953 posted

    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 :)

    Monday, January 19, 2015 6:52 AM
  • User73114 posted

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

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Monday, January 19, 2015 7:42 AM
  • User93549 posted

    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...

    Monday, January 19, 2015 9:02 AM
  • User73114 posted

    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.

    Monday, January 19, 2015 9:05 AM
  • User92953 posted

    @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...

    Monday, January 19, 2015 9:54 AM
  • User73114 posted

    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

    Monday, January 19, 2015 12:28 PM
  • User79767 posted

    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.

    Wednesday, January 21, 2015 2:16 PM
  • User79767 posted

    Okay it seems some other plugins were causing this issue.

    Wednesday, January 21, 2015 3:33 PM