Reputation: 2991
I am trying to build a Xamarin.iOS(runtime v4.0.30319) project but keep getting the following error
Severity Code Description Project File Line Suppression State Error Can not resolve reference: /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Facades/System.Threading.Tasks.Extensions.dll myApp.iOS C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Xamarin\iOS\Xamarin.iOS.Common.targets 795
When I look in C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\Xamarin.iOS\v1.0\Facades
I can see System.Threading.Tasks.Extensions.dll
exists.
and when I compare Xamarin.iOS.Common.targets
on another machine that works, there are no differences
after extensive searching I have not been able find a solution. I have also tried:
Extra information (possibly irrelevant): This is a cross platform solution and when built in the android environment, everything works as expected.
Upvotes: 2
Views: 2303
Reputation: 21
I ran into this issue as well. My solution was to launch Visual Studio on the Mac (in my case a Mac Mini) and grab all updates for Visual Studio. One of the updates specifically mentioned the System.Threading.Tasks.Extensions.dll issue that I had been experiencing. After the updates I was able to build the project.
Release note of Visual Studio 15.9.4 : "Error MT2002: Failed to resolve 'System.Runtime.CompilerServices.AsyncValueTaskMethodBuilder' reference from 'System.Threading.Tasks.Extensions...'" when building a Xamarin.iOS project." https://learn.microsoft.com/fr-fr/visualstudio/releasenotes/vs2017-relnotes#-visual-studio-2017-version-1594visual-studio-2017-version-1594-
Upvotes: 2
Reputation: 115
I too had a similar problem but there was no System.Threading.Tasks.Extensions.dll
on the Mac in the /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/lib/mono/Xamarin.iOS/Facades
folder. However on the Windows PC, this file exists in the C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\Xamarin.iOS\v1.0\Facades
folder.
The solution for me was to copy the System.Threading.Tasks.Extensions.dll
file from the Windows PC to the Mac.
Upvotes: 2
Reputation: 2991
This issue was caused by a versioning mismatch.
I was running developing in on my windows machine and deploying to an iOS device via a mac on my local network.
The iOS version held on the mac differed from the version in my xamarin iOS project (the mac had been updated by another dev).
The resolution for me was to make sure both versions were the same
Upvotes: 2