1
votes

I am new to Xamarin and have created a cross-platform project in Visual Studio 2017.

When I build that project, I am getting the below issue:

Severity: Error
Code: MSB4062
Description: The "Xamarin.Forms.Build.Tasks.XamlGTask" task could not be loaded from the assembly C:\Users\E6430\.nuget\packages\xamarin.forms\3.1.0.637273\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 <UsingTask> 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.
Project: TestApp
File: C:\Users\E6430\.nuget\packages\xamarin.forms\3.1.0.637273\build\netstandard2.0\Xamarin.Forms.targets
Line: 84

My NuGet is also get coloured with yellow colour.

Image of error message

1
have you tried to restore nuget packages, by right clicking on solution?MShah
yeah already tried but it's not workingabhinay kumar
have tried to downgrade Xamarin.Forms package version?MShah
That's the error you'll get when you have projects referencing different versions of Xamarin forms. Check your cs proj files and as MShah says downgrade the version to match, if necessary.uprightbassfan78
i have downgrade Xamarin.Forms package version also but still i am facing Same issuesabhinay kumar

1 Answers

0
votes

Try this:

  1. Unload project from the solution
  2. Restart visual studio and open solution
  3. Reload project
  4. Rebuild

If persist:

  1. Just run Visual studio as Administrator!

Ref: https://forums.xamarin.com/discussion/106784/error-with-latest-nuget-v2-5-0-77-xamarin-forms-build-tasks-gettasksabi-task-could-not-be-loaded