Skip to content

Conversation

@snakefoot
Copy link
Contributor

@snakefoot snakefoot commented Jan 29, 2025

Removed nuget-dependency System.Diagnostics.EventLog from the Castle.Core-package as it is Windows-only (And will explode in your face when used on other platforms).

Makes Castle.Core free of extra nuget-dependencies for net462 + netstandard2.1 + net8.0 (essence of core)

People using Windows and depend on the DiagnosticsLogger just have to add an additional nuget-package to their project.

Could consider changing net8.0 to net8.0-windows for Castle.Services.Logging.EventlogIntegration and remove the direct nuget-dependency.

@snakefoot snakefoot force-pushed the master branch 9 times, most recently from 90fc013 to e2d3359 Compare January 29, 2025 17:46
@snakefoot snakefoot changed the title Castle.Services.Logging.DiagnosticsLogger for Windows EventLog Castle.Services.Logging.EventlogIntegration for Windows EventLog Jan 29, 2025
@snakefoot snakefoot force-pushed the master branch 5 times, most recently from e4f9c96 to bf66485 Compare January 29, 2025 20:19
@snakefoot snakefoot changed the title Castle.Services.Logging.EventlogIntegration for Windows EventLog Castle.Services.Logging.EventLogIntegration for Windows EventLog Jan 29, 2025
@snakefoot snakefoot force-pushed the master branch 4 times, most recently from a05e9c2 to a891322 Compare January 29, 2025 20:37
@snakefoot snakefoot mentioned this pull request Jan 29, 2025
@Romfos Romfos mentioned this pull request Nov 23, 2025
10 tasks
@stakx
Copy link
Member

stakx commented Nov 29, 2025

@snakefoot, it's been a while. I've finally found a moment to look at this. Sorry for letting you wait so long.

Code conflicts resulting from the merge of #696 aside, I think we should first come to a decision on the future of Castle's logging facilities in general (see #408) before we proceed here. As long as we haven't decided for or against deprecating the logging facilities as a whole, I'd prefer not to invest too much time in them... including this PR.

I do agree that it's a bit strange to have almost all bits of a library work on all platforms except this one class, DiagnosticsLogger. But then it's also strange that the System.Diagnostics.EventLog package can even be installed successfully on non-Windows platforms. Even if we offload DiagnosticsLogger into its own package, Linux people can still install that package and have it explode in their faces.

Given these considerations, perhaps it would be much less trouble simply changing DiagnosticsLogger's XML documentation comments to make it clear that it only works on Windows!?

@snakefoot snakefoot force-pushed the master branch 3 times, most recently from 674a756 to f61e440 Compare November 30, 2025 14:35
@snakefoot
Copy link
Contributor Author

snakefoot commented Nov 30, 2025

Still think Castle.Core should have minimal dependencies, and not drag unnecessary dependencies for all users. Also considering that the Castle.Core-Logging-API is not that relevant after the introduction of Microsoft.Extensions.Logging.

The System.Diagnostics.EventLog can be installed on all platforms. Has a default implementation for non-windows platforms that explodes in your face. Do not think a XML comment will help against that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants