exceptionless / Exceptionless.Net

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

Exceptionless.Windows vs Exceptionless.Wpf #290

Closed mgnslndh closed 1 year ago

mgnslndh commented 1 year ago

I am a user of the Exceptionless.Wpf package. While looking at the source code for Exceptionless I stumbled upon ExceptionlessWindowsEnvironmentInfoCollector.cs. My app runs on Windows but I'm not seeing those process related properties in my exception reports. After some further investigation I understood that the Exceptionless.Windows package seems to be aimed at WinForms applications. The extension method ExceptionlessWindowsExtensions.Register wires up both WinForms exception handler and registers the ExceptionlessWindowsEnvironmentInfoCollector.

But I want those process handles, so I added the Exceptionless.Windows package but now I have a clash between the two Register extension methods. That can be solved, and I can register the collector with the resolver by hand.

So, all in all I have probably worked around the problem but it really seems like the Wpf package should have the Windows environment collector by default.

Maybe the packages should be split into:

niemyjski commented 1 year ago

You should only need to use the Wpf client, code is shared between the clients. I'm trying to think if there is any reason we shouldn't be capturing that environment info in wpf. I can't think of any reason not to.. Would you mind submitting a pr to add a source link to that file in the wpf project and then adding a line to client.Configuration.Resolver.Register<IEnvironmentInfoCollector, ExceptionlessWindowsEnvironmentInfoCollector>(); in register.

mgnslndh commented 1 year ago

No problem, I will do that.