Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mrherkar opened this issue Jun 25, 2023 · 4 comments · Fixed by #19261
Closed
Labels
area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info fixed-in-8.0.7 fixed-in-9.0.100-preview.1.9973 i/regression This issue described a confirmed regression on a currently supported version p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with platform/windows 🪟 t/bug Something isn't working
Milestone

Comments

@mrherkar
Copy link

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
@mrherkar mrherkar added the t/bug Something isn't working label Jun 25, 2023
@jsuarezruiz jsuarezruiz added area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info platform/windows 🪟 labels Jun 26, 2023
@jsuarezruiz jsuarezruiz added this to the Backlog milestone Jun 26, 2023
@ghost
Copy link

ghost commented Jun 26, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@mikeparker104 mikeparker104 added the partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with label Aug 30, 2023
@samhouts samhouts added p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint potential-regression This issue described a possible regression on a currently supported version., verification pending labels Aug 30, 2023
@mattleibow
Copy link
Member

Potentially a duplicate of: #7393

@samhouts samhouts changed the title Connectivity.ConnectivityChanged Event throws exception at network change [regression/7.0] Connectivity.ConnectivityChanged Event throws exception at network change Sep 19, 2023
@samhouts samhouts changed the title [regression/7.0] Connectivity.ConnectivityChanged Event throws exception at network change [regression/7.0.0] Connectivity.ConnectivityChanged Event throws exception at network change Sep 19, 2023
@samhouts samhouts modified the milestones: Backlog, .NET 7 + Servicing Sep 25, 2023
@Brosten
Copy link

Brosten commented Nov 20, 2023

I get this whenever I try access Connectivity.NetworkAccess on WinUI

@ghost
Copy link

ghost commented Jan 10, 2024

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@Redth Redth modified the milestones: Backlog, .NET 8 SR2 Jan 10, 2024
@PureWeen PureWeen moved this from Todo to In Progress in MAUI SDK Ongoing Jan 12, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in MAUI SDK Ongoing Jan 23, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 23, 2024
@samhouts samhouts added i/regression This issue described a confirmed regression on a currently supported version and removed fixed-in-8.0.14 fixed-in-8.0.10 fixed-in-8.0.40 potential-regression This issue described a possible regression on a currently supported version., verification pending labels Jul 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-essentials Essentials: Device, Display, Connectivity, Secure Storage, Sensors, App Info fixed-in-8.0.7 fixed-in-9.0.100-preview.1.9973 i/regression This issue described a confirmed regression on a currently supported version p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint partner/cat 😻 this is an issue that impacts one of our partners or a customer our advisory team is engaged with platform/windows 🪟 t/bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

8 participants