0
votes

MSB4062 The "Xamarin.Forms.Build.Tasks.XamlGTask" task could not be loaded from the assembly C:\Users\Admin.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.

Is there any solution to get rid of this error

2

2 Answers

1
votes

Clean your project, Close the project, Delete files in prefetch, temp and %temp% , Reopen the project , Rebuild the project,

If above step does not solve the problem then ensure if the NuGet package of xamarin forms installed for all the projects is of the same version (.net standard, Android and iOS).

1
votes

Finally got a solution. After downgrading the Xamarin.Forms from version 3.0.0.482510 to version 2.5.1.527436 in all the projects, it compiled without errors.