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

Unhandled Exception when closing app on Windows #9644

Closed
hoagsie opened this issue Aug 25, 2022 · 2 comments
Closed

Unhandled Exception when closing app on Windows #9644

hoagsie opened this issue Aug 25, 2022 · 2 comments
Labels

Comments

@hoagsie
Copy link

hoagsie commented Aug 25, 2022

Description

I defined a MAUI app with just an Entry control and WebView control. When I use the Entry to change the WebView Source I then get an exception when I close the app. This does NOT happen if I freshly launch the app, wait for the initial page to load, and close the app without navigating elsewhere. I've tried setting the Source initially of the WebView to the site I'm navigating to (such as https://www.reddit.com) and then closing the app without navigating to a new site. This also does not cause an unhandled exception. The only case when I get an exception on exit is when I've navigated to another URL Source at runtime.

Steps to Reproduce

  1. Create a new MAUI project.
  2. Configure it to only target Windows.
  3. Restart Visual Studio so you don't get prompted about the Android SDK license.
  4. Replace MainPage.xaml with
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="30"/>
      <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="*"/>
    </Grid.ColumnDefinitions>
    <Entry
      x:Name="AddressEditor"
      Completed="Entry_OnCompleted"
      Grid.Row="0"
      />
    <WebView
      x:Name="WebBrowser"
      Source="https://www.google.com/"
      Grid.Row="1"
    />
  </Grid>
  1. Go to code view and define Entry_OnCompleted as:
  private void Entry_OnCompleted(object sender, EventArgs e)
  {
    WebBrowser.Source = new UrlWebViewSource { Url = AddressEditor.Text };
  }
  1. Launch app with F5.
  2. Enter a valid URL in the Entry control and hit enter.
  3. Wait for the view to load and render the site.
  4. Close the window with the X icon in the upper-right.
  5. Observe a prompt about an error involving an unhandled exception.
A debugger is attached to xxx.exe but not configured to debug this unhandled exception. To debug this excpetion, detach the current debugger.

Version with bug

6.0.400

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Proj TargetFramework is net6.0-windows10.0.19041.0; Local running Windows build is 10.0.22000 Build 22000

Did you find any workaround?

No.

Relevant log output

No response

@hoagsie hoagsie added the t/bug Something isn't working label Aug 25, 2022
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Aug 25, 2022
@u1-kino
Copy link

u1-kino commented Aug 25, 2022

This issue seems to have the same cause as [Windows app gets a unknown win32 error on exit #7317].

@PureWeen
Copy link
Member

Also related #8323

@ghost ghost locked as resolved and limited conversation to collaborators Sep 24, 2022
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants