Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6542339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:12:52+00:00 2026-05-25T11:12:52+00:00

I am using a 3rd party WinForms Login Dialog in my WPF app, and

  • 0

I am using a 3rd party WinForms Login Dialog in my WPF app, and for some reason this is making my WPF application not close correctly when debugging.

If I exit the winforms login dialog prior to logging in, the application closes correctly, however if I login successfully and launch the WPF window, exiting the window does not shut down the application.

I put a breakpoint in the OnExit method of App and it never gets called. I overwrote the OnClosing method of my main window, and that does get called but even calling Application.Current.ShutDown() doesn’t exit the application correctly. I have also tried setting my App’s ShutdownMode to OnExplicitShutdown and OnMainWindowClose and neither of those shut it down.

The only hint I have is the following appears in the Debug window, but I have no idea what it’s trying to tell me.

The thread 'vshost.RunParkingWindow' (0xf74) has exited with code 0 (0x0).
The thread <No Name> (0x1b58) has exited with code 0 (0x0).

This behavior only occurs when running in Debug mode in Visual Studio. Running the app without debugging closes the app correctly.

Can anyone point me in the right direction as to what could be causing this behavior?

Edit

The WinForms login dialog is not a traditional login dialog with a Show() or Close() method, it’s a static class that only has a Login() and Logout() method.

It’s used by someething like this:

if (CompanyNamespace.ApplicationName.Login())
{
    var shell = new ShellView();
    var context = new ShellViewModel();
    shell.DataContext = context;
    shell.Show();

    // When the Shell Window gets closed, the debugger doesn't stop
}
else
{
    Application.Current.Shutdown(); // Works fine
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T11:12:53+00:00Added an answer on May 25, 2026 at 11:12 am

    this sounds stupid, but have you tried to call winformsLoginDialog.Close(); in the onClosing method of your main window? I suspect the winforms login dialog still has a thread running, and/or the form may have been hidden instead of closed.

    You could try System.Environment.Exit(0)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is driving me nuts. I am using some 3rd-party code in a Windows
My WPF test app (very simple, just one window) is using a 3rd party
I'm using some 3rd party AWT components in a desktop application. The component's layout
I'm using a 3rd party DLL written in unmanaged C++ that controls some hardware
I'm using a 3rd party lib to do some work. I'm passing an object
i am using 3rd party api and this is what is its returning me:
I am using a 3rd party app in my django webapp. But I want
When using 3rd party libraries/components in production projects, are you rigorous about using only
I am using a 3rd party API which is defined in 2 DLLs. I
I am using a 3rd party component which creates settings files based on hard-coded

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.