Skip to content

[Windows] Connectivity changed on throws an exception and sometimes crashes the app #7393

@janseris

Description

@janseris

Description

When I switch between airplane mode and non-airplane mode in the train (train wifi is available) first ConnectivityChanged works well.
Every subsequent change of the connectivity throws this exception:

Exception thrown: 'System.Runtime.InteropServices.COMException' in WinRT.Runtime.dll
WinRT information: The application called an interface that was marshalled for a different thread.

The application called an interface that was marshalled for a different thread. (0x8001010E (RPC_E_WRONG_THREAD))

Also, when this happens, the Connectivity.ConnectivityChanged event handler is usually (not regularly) not hit again (I print current connection status in this event handler).

Sometimes, the app crashes with this exception and sometimes it does not. The application crashes when ConnectivityChanged eventhandler is executed. The application however sometimes still crashes without entering the event handler at all.

There is no issue on Android.

Steps to Reproduce

MAUI Blazor app Debug mode

  • change internet connectivity

Version with bug

Release Candidate 3 (current)

Last version that worked well

RC 2 I think

Affected platforms

Windows

Affected platform versions

Windows 10 21H1

Did you find any workaround?

no

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-essentialsEssentials: Device, Display, Connectivity, Secure Storage, Sensors, App InfohighIt doesn't work at all, crashes or has a big impact.platform/windowss/needs-infoIssue needs more info from the authors/no-recent-activityIssue has had no recent activitys/triagedIssue has been revieweds/try-latest-versionPlease try to reproduce the potential issue on the latest public versiont/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions