Skip to content

[regression/7.0.0] Connectivity.ConnectivityChanged Event throws exception at network change #15843

@ghost

Description

Description

This exception is thrown at network connection change after I subscribe to Connectivity.ConnectivityChanged event

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

Steps to Reproduce

  1. Create a new . NET MAUI App, framework .NET 7.0
  2. Subscribe to Connectivity.ConnectivityChanged event
  3. Connectivity.ConnectivityChanged += (sender, e) => { // never reach this point };
  4. start the app in Debug mode and change network connection to see the exception. This exception does not crash the app.

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

In Release mode it seems the only problem is if the event never get called.

If I change Windows target framework to .NET 6.0, event is called and it seems fine, but exception message is there

Screenshot (215)

It works fine on Android.

Link to public reproduction project repository

https://github.com/mrherkar/MauiAppWithConnectivityChangedIssue

Version with bug

7.0.86

Last version that worked well

6.0

Affected platforms

Windows

Affected platform versions

Windows SDK 10.0.19041.0

Did you find any workaround?

no

Relevant log output

C:\Windows\system32>dotnet workload list

Installed Workload Id      Manifest Version       Installation Source
---------------------------------------------------------------------
maui-windows               7.0.86/7.0.100         VS 17.6.33815.320
maui-maccatalyst           7.0.86/7.0.100         VS 17.6.33815.320
maccatalyst                16.4.7067/7.0.100      VS 17.6.33815.320
maui-ios                   7.0.86/7.0.100         VS 17.6.33815.320
ios                        16.4.7067/7.0.100      VS 17.6.33815.320
maui-android               7.0.86/7.0.100         VS 17.6.33815.320
android                    33.0.46/7.0.100        VS 17.6.33815.320

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-essentialsEssentials: Device, Display, Connectivity, Secure Storage, Sensors, App Infofixed-in-8.0.7fixed-in-9.0.100-preview.1.9973i/regressionThis issue described a confirmed regression on a currently supported versionp/1Work that is important, and has been scheduled for release in this or an upcoming sprintpartner/cat 😻this is an issue that impacts one of our partners or a customer our advisory team is engaged withplatform/windowst/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions