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

WPF application not terminating when using v2.9.0-beta3 or newer #1080

Closed
IGx89 opened this issue Feb 4, 2019 · 5 comments
Closed

WPF application not terminating when using v2.9.0-beta3 or newer #1080

IGx89 opened this issue Feb 4, 2019 · 5 comments
Assignees
Labels
Milestone

Comments

@IGx89
Copy link

IGx89 commented Feb 4, 2019

If you are reporting bug/issue, please provide detailed Repro instructions.

Repro Steps

  1. Open Visual Studio and create a new WPF application
  2. Add the "Microsoft.ApplicationInsights.WindowsServer" NuGet package, v2.9.0-beta3 or v2.9.0 (final)
  3. Add the following line into MainWindow's constructor: TelemetryConfiguration.Active.InstrumentationKey = ""; (per instructions on https://docs.microsoft.com/en-us/azure/azure-monitor/app/windows-services#4-send-telemetry)
  4. Press F5 to start the application, then exit it by clicking the "X" on the application window

Actual Behavior

Window closes but application doesn't terminate.

Expected Behavior

Application fully terminates.

Version Info

SDK Version : 2.9.0 beta 3 or newer (beta 2 or older, like v2.8.1, don't have this issue)
.NET Version : 4.7.2
How Application was onboarded with SDK(VisualStudio/StatusMonitor/Azure Extension) : Visual Studio
OS : Windows 10 1803
Hosting Info (IIS/Azure WebApps/ etc) : N/A

@IGx89
Copy link
Author

IGx89 commented Feb 4, 2019

Best guess is that this was caused by #1028, which creates a new non-background thread. Since the thread isn't set as Background and apparently isn't being terminated by the code, the application can't fully terminate.

CC @macrogreg

@IGx89
Copy link
Author

IGx89 commented Feb 4, 2019

I also attempted adding TelemetryConfiguration.Active.Dispose(); to Application_Exit, with no luck either.

@Dmitry-Matveev
Copy link
Member

@IGx89 , thanks a lot for catching this. PR #1081 is to address this issue.

@Dmitry-Matveev
Copy link
Member

@IGx89 , we shipped 2.9.1 stable with the fix. Thanks again for reporting!

@Dmitry-Matveev Dmitry-Matveev modified the milestones: 2.10, 2.9.1 Feb 8, 2019
@IGx89
Copy link
Author

IGx89 commented Feb 8, 2019

Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants