Could not load assembly Microsoft.Threading.Tasks.dll

心不动则不痛 提交于 2019-12-06 15:04:37

I had such problem. It was caused by missing nuget packages in Droid project. Some of my subprojects referenced packages which had "Microsoft.Threading.Tasks" in references (PCLStorage, Restsharp portable). But in main Droid project I did not added this packages. After adding missing packages (PCLStorage, Restsharp portable) to Droid everything started work.

Is there any reason you are using Profile7?

I would recommend you create a project with profile 259, that is the default one for Xamarin Forms projects.

Otherwise you need to get a reference to that DLL. Normally I try installing the BCL NuGet package as my first port of call, but it might not be included in there: https://www.nuget.org/packages/Microsoft.Bcl/

Update

If you are having linker issues, you can skip certain assemblies: https://developer.xamarin.com/guides/ios/advanced_topics/linker/#Skipping_Assemblies

Sometimes the linker is more aggressive than anticipated.

I had the same problem.

  1. Right click and select Options for the Android project.
  2. Go to Build->General and uncheck "Use MSBuild build engine (recommended for this project type)"

Now I could build again!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!