You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NLog 5.2.2 added trimming support. With growing adoption of MAUI, more and more users are trying to trim their apps.
We need to:
Bump to 5.2.2
Provide enough information about the custom configuration type used with NLog that it either doesn't try to load certain properties or the linker preserves any types required to load those properties.
Worth investigating @snakefoot 's comment about the complexity of the SentryNLogOptions class. If people are only using the NLog integration then ideally they'd be putting all of their Sentry config in one place, but maybe worth challenging that as it creates additional complexity (like this) elsewhere.
And then you should provide a registration-method, that marks the relevant types in Sentry.NLog to not be trimmed (This already happens for all types inside NLog):
You should probably avoid mixing options that are not intended to be assigned from NLog-configuration-file. Maybe SentryNLogOptions should not inherit from SentryOptions. But should instead just expose the properties that are intended to be assigned from NLog-configuration-file. Then you could have a property in SentryNLogOptions marked like this:
Notice the AOT-issues that NLog v6 will be fixing is removing the dependency on RegEx and XmlReader and ExpressionTrees, since they include code-generation-abilities and there is no JIT-compiler included with pure AOT-builds.
The text was updated successfully, but these errors were encountered:
Alternative you could remove [NLogConfigurationItem] from SentryNLogOptions, and maybe move any convience-properties from SentryNLogOptions to the NLog SentryTarget directly:
<!-- Advanced options can be configured here-->
<options
sendDefaultPii="true"
attachStacktrace="false"
shutdownTimeoutSeconds="5"
debug="false"
>
<!--Advanced options can be specified as attributes or elements-->
<includeEventDataOnBreadcrumbs>true</includeEventDataOnBreadcrumbs>
</options>
Right now [NLogConfigurationItem] has 2 meanings. Its safe for NLog to perform object-reflection for assigning properties. And its safe for NLog to perform object-reflection to enlist any NLog Layouts.
NLog 5.2.2 added trimming support. With growing adoption of MAUI, more and more users are trying to trim their apps.
We need to:
Worth investigating @snakefoot 's comment about the complexity of the
SentryNLogOptions
class. If people are only using the NLog integration then ideally they'd be putting all of their Sentry config in one place, but maybe worth challenging that as it creates additional complexity (like this) elsewhere.Originally posted by @snakefoot in #3680
The text was updated successfully, but these errors were encountered: