Code MSB4062

MagnvmMagnvm USMember ✭✭✭

Hi Xamarin Forum,
I notice one thing when I update my Xamarin.Forms to 3.0.0.446417 in VS 2017 when I start a new project either .Net or shared I immediately got the error MSB4062 The "Xamarin.Forms.Build.Tasks.XamlGTask" task could not be loaded from the assembly. Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

So how can I fix this?
Thank you

Answers

  • SzbestaSzbesta Member ✭✭✭

    @KyleMarcOliveros Had the same issue last week. My fix was to delete all old SDKs in the SDK manager and only have the newst installed. Hope it helps!

  • MagnvmMagnvm USMember ✭✭✭

    @Szbesta I tried your suggestion under Android SDK Tools I have two choices Android SDK ver 26.1.1 and Android SDK 25.2.5 Im currently using version 26.1.1 and my Android SDK Platform-Tools is version 27.0.1 my SDK Build Tools is also on 27.0.3 but still Im having that stupid error

  • SzbestaSzbesta Member ✭✭✭

    @KyleMarcOliveros What Android Version are you using in the SDK? 8.1 Oreo ?

  • MagnvmMagnvm USMember ✭✭✭

    @Szbesta yes Im using 8.1 Oreo anyway its gone but another error has come up and its code is CS0006 the dll could not be found

  • norse_dognorse_dog Member

    Were you able to resolve this issue?
    I am struggling with exactly same problem. When I create totally fresh project I immediately get error:

    Severity Code Description Project File Line Suppression State
    Error MSB4062 The "Xamarin.Forms.Build.Tasks.XamlGTask" task could not be loaded from the assembly C:\Users.nuget\packages\xamarin.forms\3.0.0.482510\build\netstandard2.0\Xamarin.Forms.Build.Tasks.dll. Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. UMCApp C:\Users.nuget\packages\xamarin.forms\3.0.0.482510\build\netstandard2.0\Xamarin.Forms.targets 71

    Any suggestion?

  • MagnvmMagnvm USMember ✭✭✭

    @norse_dog on my side what I did was re install everything then download that android sdk stand alone only then run that android sdk stand alone from windows not through vs2017 then it will tell you what it needs to tbe downloaded by default the checkbox has check on it just install download what is has check on its checkbox then thats it

  • norse_dognorse_dog Member

    @Magnvm So I have downloaded Android SDK and downloaded all latest versions. After that I configured VS to use new SDK location. Sadly, it did not change anything.
    Right now I have:
    Android SDK Tools 26.1.1
    Android SDK Platform-Tools 27.0.1
    Android SDK Build-Tools 27.0.3 (this is what shows though VS, however Android Studio shows 28-rc2)
    Android Emulator 27.2.9

  • MagnvmMagnvm USMember ✭✭✭

    @norse_dog did you run the sdk from program menu of windows after you install it

  • norse_dognorse_dog Member

    It seems like it is a bug.
    I have found article about this particular problem, Xamarin.Forms.Build.Tasks.GetTasksAbi build error #2667 in Xamarin Github.

    Anyway I will just downgrade to 2.5 until issue is resolved.

  • Hello guys, I'm having again the same issue now on version 3.0.0.482510.

    Any suggest? is this problem related to Android SDK?

  • MagnvmMagnvm USMember ✭✭✭

    @mauro_alvarado mine is solved somehow

  • I figure it out, NET Framework must be upgraded to 4.7.3.

  • MagnvmMagnvm USMember ✭✭✭

    @mauro_alvarado so in your side its Net Framework in which in my side it is not Net Framework it is the Android SDK

  • LesFergLesFerg NZMember ✭✭
    edited July 2018

    Re: Xamarin Github issue #2667, I found the comment "4.7.1 is required for netstandard2."

    Why on earth would the visual studio installer install software versions which do not run on my current version of operating system? This is just an absurd situation. Why didn't the Xamarin update get blocked or even at least warn us that it would not work on the current version of Windows?

    The reality is that people in corporate environments do not always have control over their Windows update regime, and cannot expect to always have the latest release.

    At the very least, the new project templates should be matched to what is available on the current system.

  • avrhilavrhil Member ✭✭

    Same Issue me too??

  • avrhilavrhil Member ✭✭
    edited November 2018

    Severity Code Description Project File Line Suppression State
    Error Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. XXPlayer XXX\Repos\XXXPlayer\XPlayer\XPlayer\DSPlayer\App.xaml 1

  • MNadeemMNadeem Member ✭✭

    Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.

    please help me.

  • MatthewRegulMatthewRegul USXamarin Team Xamurai
    edited January 31

    Ensure you have .NET 4.7.1 or higher installed (along with everything else updated)

Sign In or Register to comment.