Reputation: 245
I can't seem to debug PCL library (using a very simple test project). When breakpoint hits and watch window reloads, it throws CS0012: The type 'TaskAwaiter<>' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Threading.Tasks, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null'.
Local and auto windows remain empty.
I'm using Visual Studio 2015 RTM (I didn't upgrade from any previous versions - it's a clean install from ISO) on Windows 10 Pro (clean install as well). My test project targets Windows Phone 8.1 and I debug using an actual device.
I found a couple of references to a similiar bug, but it occurred during building the solution. In my case, solution builds just fine, no errors or warnings.
I tried adding System.Threading.Tasks.dll
manually, but VS won't let me - it says it's added automatically by build system.
Has anyone came across this issue as well (and hopefully fixed it)?
Upvotes: 10
Views: 2518
Reputation: 376
(Since I have not enough reputation to comment, I have to write a new answer...)
Be sure to stop debugging before trying to check the Use the legacy C# and VB expression evaluators box. Otherwise it will be grayed out.
Upvotes: 0
Reputation: 1
I found the solution for me to solve this CS0012 error issue in this Blog.
Just added reference to the missing dlls from :
"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5.2\Facades"
and the errors disappeared.
Upvotes: 0
Reputation: 166
I've had exactly the same error CS0012: ...TaskAwaiter<>... This is a known issue in VS2015.
https://support.microsoft.com/en-us/kb/3025133
To solve it go to Debug - Options - General - Use the legacy C# and VB expression evaluator (tick)
Upvotes: 15