4

I seem to be unable to debug any code which uses the async keyword. Does anyone have any idea to solve this? I am completely clueless. I tried different linking settings as suggested by several people, however without success. Any breakpoint before the use of async works.

EDIT: When I open the solution with Xamarin Studio on a mac, debugging the code works just fine. However I would prefer to develop in Visual Studio.

ANOTHER EDIT: I 'resolved' it by creating all the projects in Xamarin Studio. If I ever find out what the problem was, I will post it here.

Sample breakpoint

Yoeri
  • 2,249
  • 18
  • 33
  • Look at this question - http://stackoverflow.com/questions/2301216/the-breakpoint-will-not-currently-be-hit-no-symbols-have-been-loaded-for-this-d – choper Mar 20 '14 at 12:14
  • is this code in a library or PCL? – thumbmunkeys Mar 20 '14 at 12:24
  • Thanks for the suggestion, but I don't think any of the answers are relevant for my situation. Just the async stuff isn't debuggable, for any other line of code the symbols are loaded. – Yoeri Mar 20 '14 at 12:25
  • @thumbmunkeys this is in a library (iOS library project). – Yoeri Mar 20 '14 at 12:26
  • Perhaps you need to add a reference to Microsoft.Bcl.Async from nuget? – valdetero Mar 20 '14 at 15:08
  • Is the code you show above inside a PCL or other library or part of your iOS app? If it is inside a lib, try breaking at the last position inside your app and then step your way down into the lib and see if that works. Next, check Configuration Manager if your lib is actually set to build if you build the iOS project. Also check this: https://bugzilla.xamarin.com/show_bug.cgi?id=18187 – Krumelur Mar 20 '14 at 21:24
  • As stated, it's an iOS library. I tried to break in the startup project and as soon as I encounter a line with the async keyword the debugger just continues. Thanks for the suggestions. The bug looks a lot like my problem, except for the symbols that aren't loaded in my case. Tomorrow I'll mail my project to the Xamarin support. I'll hope they can help me out. – Yoeri Mar 20 '14 at 23:16
  • I would really like to know this as well. Any updates on this? I am unable to debug a PCL using asynchronous code, but the problem only persists on iOS. – Demitrian Nov 19 '14 at 14:17
  • TBH I gave up on this. I deleted the project (which was in its starting phase anyway). Reinstalled Xamarin with all updates on windows and OSX. The problem just went away, so far didn't reoccur. – Yoeri Nov 19 '14 at 17:32
  • Seems weird :-/ I guess that Xamarin Support is the only way to go forward. I see that you tried the same during March the 20th, @Yoeri. Did you ever get any response? – Demitrian Nov 20 '14 at 09:52
  • Nothing useful, only more questions. I think it ended with me trying to reproduce the issue in a test case. I couldn't reproduce it since the problem went magically away. If I were you, I'd remove xamarin completely, reboot, reinstall, start a new project and copy the code in the new project. – Yoeri Nov 20 '14 at 15:47

2 Answers2

0

You could try to clean the solution and build it again, also delete the app from your device.

It is possible that you could be running unmatched versions of the code.

Dan Miranda
  • 161
  • 1
  • 3
0
  1. Restart your machine, after done DO NOT start VS yet
  2. Navigate to C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root
  3. Delete all debugging caches
  4. Do the same for this folder..C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root
  5. Start VS, make sure its running as admin.
  6. Set your breakpoint, verify symbols are loaded and breakpoint holds.
foxtrotZulu
  • 1,109
  • 11
  • 24
  • I'm desperate enough to try this .. but why should I remove content from an ASP.NET folder? – Yoeri Mar 20 '14 at 16:17
  • when debugging everyday, temp files are created for every debug instance, if youre like me and have a ton of debug instances going on everyday you must clean out your debug cache. Its safe todo this every morning before you start up VS. The alternative is a VS instance that still thinks its debugging an old version of the code, thus symbols wont load. What I'm recommending is just one thing you should always do to verify your symbols will load on a fresh debug instance. If somehow they still dont load you know its not your cache.. – foxtrotZulu Mar 20 '14 at 16:27
  • when doing this make sure you delete all alphanumeric folders under root for both URI's above.. – foxtrotZulu Mar 20 '14 at 16:28