Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2015: The type 'XXX' is defined in an assembly that is not referenced while debugging

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)?

like image 238
eggplant Avatar asked Aug 03 '15 10:08

eggplant


1 Answers

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)

like image 131
Los Santreas Avatar answered Oct 21 '22 15:10

Los Santreas