Skip to content

Conversation

@bouwkast
Copy link
Collaborator

Summary of changes

Try to protect against a TypeInitializationException and FileLoadException being seen in NLog

Reason for change

Thought process is that the previous method was resolving the incorrect NLog assembly? This way may get the exact one?
🤷

https://learn.microsoft.com/en-us/dotnet/fundamentals/reflection/viewing-type-information

Use Assembly.GetType or Assembly.GetTypes to obtain Type objects from assemblies that have not been loaded, passing in the name of the type or types you want. Use Type.GetType to get the Type objects from an assembly that is already loaded. Use Module.GetType and Module.GetTypes to obtain module Type objects.

Implementation details

Swaps from using GetType() to Assembly to bypass the assembly resolution logic.

Test coverage

None, unsure how it actually emerges

Other details

@bouwkast bouwkast requested review from a team as code owners October 29, 2025 15:47
@bouwkast bouwkast added identified-by:telemetry AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos labels Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI Generated Largely based on code generated by an AI or LLM. This label is the same across all dd-trace-* repos area:integrations identified-by:telemetry type:bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants