❔ IDE error when trying to debug
I can't debug a very specific body of code without receiving a strange error. "No compatible code running on the thread."
This is with Xamarin, a navigation bar is selected and the code within this function should run.
26 Replies
Is that breakpoint being hit?
Since the no compatible code only occurs when I select a side bar item I'd assume that its going into that onNavigationItemSelected and the moment it does I get that error.
A quick google search came up with this stackoverflow question. Have you seen it?
https://stackoverflow.com/questions/46344434/xamarin-android-debugging-no-compatible-code-running
Stack Overflow
Xamarin Android debugging: No compatible code running
Context
I am using VS 2017.3 to develop Xamarin.Forms application. I am trying to diagnose where and why an Exception occur on my code.
I can successfully deploy run and debug my application usi...
I had found that awhile back but never read to the very button of the page where someone states "Exception settings were my fix" I'm not sure what exception settings are, I'm going to start googling.
I've tried restoring my exceptions to default settings, that didn't work.
I even tested by turning off all exceptions, still encountering this issue.
Is it throwing an exception?
An exception would be on the error list right?
Nothing there anyways
That stackoverflow thread made it sound like it's pausing in the native code when it tries to hit your breakpoint. The top answer said they just had to hit Continue a few times to get it back into their event code. But idk if that works for you
Hitting continue allows the code to continue, but it doesn't actually go into the function and show me what is happening line for line, its like it steps over the entire thing and everything that should happen in that function happens.
This thread talks about there being two different debuggers for Android apps, maybe you could try swapping the one you're using? It seems like your breakpoint is being hit but the debugger you're using isn't able to debug wherever that code is being run https://stackoverflow.com/questions/32069462/using-microsoft-debugger-with-xamarin-android?rq=4
Stack Overflow
Using Microsoft debugger with Xamarin Android
There's an option in the Android project settings in the Android Options section on the Packaging tab that lets you choose between the Xamarin debugger or the Microsoft debugger. The Xamarin debugger
There isn't an option like that in here. Alot of these posts are older and the newer version of VS changed alot of things.
Try the C++ one
I think its the same error as the one on that post, gonna read about it.
Not the same error
The only answer I found to that is "Make sure you use the Xamarin debugger" XD
damn
I've even created a post about this on developercommunity https://developercommunity.visualstudio.com/t/No-compatible-code-running-on-thread-xa/10405286?. Have had this problem for a week now and just can't get myself to continue coding because of this issue.
Developer Community
Developer Community
Does the same thing happen if you debug elsewhere in your program?
no
its only in that area
its very specific to that
If I put a breakpoint anywhere in here it breaks
But you said that it does actually run the code correctly if you hit continue, yeah?
yep
Well that's good at least. I'm curious what happens if you call one of your own methods inside there and put a breakpoint in that method instead
I've tried that, same issue.
I put a breakpoint within the function that was present within that OnNavigation and it did the same thing.
same issue every time.
I actually have a friend on discord that doesn't have this issue. He downloaded xamarin and tested it, and he was able to debug no problem within this function. I imagine I may be a really rare case.
I wish I could get more info from him, the version of VS he's using, why he's able to get into it. But he's been ghosting me a bit because I've been overburdening on the issue.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.