exceptionless / Exceptionless.Net

Exceptionless clients for the .NET platform
https://exceptionless.com
Other
554 stars 142 forks source link

Exceptionless.Wpf shouldn't reference System.Windows.Forms #224

Closed PhyxionNL closed 4 years ago

PhyxionNL commented 4 years ago

I see work is done for .NET Core WPF here: https://github.com/exceptionless/Exceptionless.Net/tree/feature/net-core-wpf The WPF project shouldn't use WinForms (same for the current tree), if the WinForms exception currently catched is actually required (unlikely if you use WPF) then you can also reference the Windows project and manually call RegisterApplicationThreadExceptionHandler.

niemyjski commented 4 years ago

Can you do some research into this and submit a pr to that branch. That would be greatly appreciated. We probably didn't need it but it was submitted as part of the previous pr.

PhyxionNL commented 4 years ago

It's unneeded, ThreadException is only thrown for exceptions that occur on WinForms threads. If WinForms isn't used, there's no point to add this and only causes this assembly to get loaded unnecessary. If someone actually uses WinForms in combination with WPF then simply include the Windows project and call RegisterApplicationThreadExceptionHandler. I can submit a PR for it.

PhyxionNL commented 4 years ago

225 @niemyjski.

BTW, both Windows and WPF project are currently limited to one client due to the usage of only one static event handler. I don't think multiple clients are often used but that's currently not possible.