unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
8.87k stars 716 forks source link

No compatible code running on the thread #12635

Closed sitecompass closed 1 year ago

sitecompass commented 1 year ago

Current behavior

Using MVVM Toolkit, and Command, add a button to the xaml, bind the button to the command and place a breakpoint within the code. Then debug on either emulator of physical device and an this error comes up:

image

Expected behavior

Break point should be hit

UnoApp4.zip

How to reproduce it (as minimally and precisely as possible)

No response

Workaround

None

Works on UWP/WinUI

Yes

Environment

Uno.UI.RemoteControl / Uno.WinUI.RemoteControl

NuGet package version(s)

No response

Affected platforms

Android

IDE

Visual Studio 2022

IDE version

17.6.3

Relevant plugins

None

Anything else we need to know?

No response

sitecompass commented 1 year ago

Ok, I have an update, when trying this on an earlier version of Visual Studio (17.4.8) the issue is no longer happening.

This then appears to be a Uno Platform / Visual Studio 17.6.3 (also tried .2) issue as MAUI does not have this issue either

Youssef1313 commented 1 year ago

This seems like a Visual Studio bug.

People are complaining in https://stackoverflow.com/questions/76337441/xamarin-forms-breakpoint-not-hit-on-android-no-compatible-code-running-on-the-t in 17.6 as well and not related to Uno Platform.

I can't find any vsfeedback item for this though.

Stack Overflow
Xamarin forms breakpoint not hit on android [No compatible code running on the thread]
When I put a breakpoint on an event function on any project, even on a project I just created. I get: No compatible code running on the thread This happens only on Android projects, on Uwp projects...
NalonAu commented 1 year ago

Thanks @Youssef1313. Yeah I got the opinion of it being Uno related only because it doesn't happen with MAUI. Seeing that stack overflow link it does appear to be maybe more of an issue with Visual Studio and Xamarin platforms (including Uno Platform).

I'm actually surprised this issue hasn't become more public considering how blocking it can be.

MCAleckson commented 1 year ago

This bug is now stopping my team as well. Flying blind without the ability to debug...

NalonAu commented 1 year ago

This bug is now stopping my team as well. Flying blind without the ability to debug...

Hey, so the only way I was able to get around this was to roll back visual studio to 17.4.8. hopefully this gets fixed soon. This issue doesn't happen with MAUI but does affect Xamarin/Uno projects

Youssef1313 commented 1 year ago

https://developercommunity.visualstudio.com/t/no-compatible-code-running-on-the-thread/10376723

Developer Community
Developer Community
jeromelaban commented 1 year ago

The issue on VS community has been marked as in the process of being published.