apm-agent-dotnet: Object Reference after updating 1.8.1 -> 1.9 (Elastic.Apm.Agent.Tracer is null)
APM Agent version
Elastic.Apm 1.9.
Environment
Windows .Net Framework 4.7.2
Describe the bug
It looks like Elastic.Apm.Agent.Tracer behavior changed in 1.9 (previously was 1.8.1) In DEBUG mode (local execution) we don’t Initialize APM. After updating the assembly Elastic.Apm.Agent.Tracer became null
For example, we have an Object reference
- Windows Service
var transaction = Elastic.Apm.Agent.Tracer.StartTransaction(FullName, ApiConstants.TypeRequest); - WebSite in APM SQL Interceptor

It is not critical, I’ve fixed it all on our side. This Issue FYI only, feel free to close it.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 15 (5 by maintainers)
Commits related to this issue
- Use Logger to log exception in AgentComponents initialization This commit fixes a bug in logging an exception that may occur during agent initialization; the Logger property is used instead of the lo... — committed to russcam/apm-agent-dotnet by russcam 3 years ago
- Use Logger to log exception in AgentComponents initialization (#1305) This commit fixes a bug in logging an exception that may occur during agent initialization; the Logger property is used instead... — committed to elastic/apm-agent-dotnet by russcam 3 years ago
@iqmeta you got the same issue. Check your assembly bindings
But I’m not sure if it can be safely removed for your application.